Español
Bugs y vermeintliche

Bug beim &-Operator en Arrays

 

Sebastian
Sprenger
Wenn uno una Array una neuen Valor zuweist y innerhalb el eckigen Klammern una binäres Und (&-Operator) es, se dieses como logisches Und interpretiert (d.h. lo se sólo en Element 0 oder 1 geschrieben).
Das tritt wiederum sólo en el Runtime en, no aber en el Interpreter.

(Getestet bajo XProfan 9 y OGLBasic 1.0.
Yo weiß no, si el Fehler ya bekannt es oder en XProfan 11 auch todavía auftritt...)
KompilierenMarcaSeparación
declare a%[3]
a%[0]=16
a%[1]=17
a%[2]=18
a%[3]=19
cls
print "2 & 2        ->",2 & 2
print
print "a%[2 & 2]    = ",2 & 2
Diese Zeile sollte eigentlich in a%[2] schreiben,
schreibt in der Runtime aber tatsächlich in a%[1]:
a%[2 & 2]=2 & 2
print
print "a%[0]        ->",a%[0]
print "a%[1]        ->",a%[1]
print "a%[2]        ->",a%[2]
print "a%[3]        ->",a%[3]
print
Das Lesen funktioniert hingegen immer richtig:
print "a%[2 & 2]    ->",a%[2 & 2]
Profan² 7.0e, XProfan 9, 11.2a, FreeProfan32
Windows Vista Home Premium 32-Bit, 2.8 Ghz, 4 GB RAM
Windows Me, 1.8 Ghz, 256 MB RAM
02.08.2008  
 




Jörg
Sellmeyer
Das kommt en me fuera:

Ok - Yo war vorschnell. Im Kompilat auch falso

10 kB
Hochgeladen:02.08.2008
Ladeanzahl249
Descargar
9 kB
Hochgeladen:02.08.2008
Ladeanzahl244
Descargar
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
02.08.2008  
 




RGH
Ok, Yo weiß zwar todavía no woran lo liegt, pero yo weiß una Workaround: Klammern!

a%[(2 & 2)] = 2 & 2

funktioniert interpretiert y kompiliert, So como aussieht war dieses seltsame Comportamiento wohl seit el Einführung el Arrays y Operatoren ya así. Como lo ahora sólo auffiel. scheint esta Konstruktion (binäre Operatoren en el Arrayindex en Zuweisung) wohl más selten vorkommen.

Yo hoffe lo en el nächsten Versión a beheben.

Saludo
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
03.08.2008  
 




Michael
Dell
Will Usted no erschrecken Roland aber el funktioniert auch no.

Bleibt sólo el Umweg encima ne Variable.

var zw% = 2 & 2
a%[zw%] = 2 & 2
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
03.08.2008  
 




Sebastian
Sprenger
RGH
seit el Einführung el Arrays y Operatoren ya así.

No bastante, en Profano² 7.0e se ejecuta alles korrekt.
Michael Dell
Bleibt sólo el Umweg encima ne Variable

...oder en @And-Función (con oder sin PROFALT.INC).
Yo glaube auch, lo kommt wirklich sólo el &-Signo direkt innerhalb des   a. Hier una gefälliges Ejemplo:
KompilierenMarcaSeparación
declare a%[2]
def mbox(0) messagebox(str$(2 & 2),"",0)
mbox()
messagebox(str$(2 & 2),"",0)
a%[mbox()]=0
a%[messagebox(str$(2 & 2),"",0)]=0
En el ersten drei MessageBoxes kommt en me 2, y en letzten 1.
Saludo, Sebastian
 
Profan² 7.0e, XProfan 9, 11.2a, FreeProfan32
Windows Vista Home Premium 32-Bit, 2.8 Ghz, 4 GB RAM
Windows Me, 1.8 Ghz, 256 MB RAM
03.08.2008  
 




RGH
¡Hola,
auch dieser Bug se en XProfan 11.1 Fijo ser!

Saludo
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
11.11.2008  
 



Respuesta


Título del Tema, max. 100 Signo.
 

Systemprofile:

Kein Systemprofil creado. [anlegen]

XProfan:

 Contribución  Font  Smilies  ▼ 

Bitte registro en una Contribución a verfassen.
 

Tema opciones

7.772 Views

Untitledvor 0 min.
Michael W.26.03.2016
Sebastian Sprenger19.03.2013

Themeninformationen



Admins  |  AGB  |  Applications  |  Autores  |  Chat  |  Política de Privacidad  |  Descargar  |  Entrance  |  Ayuda  |  Merchantportal  |  Pie de imprenta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Juegos  |  Búsqueda  |  Support

Ein Projekt aller XProfan, el lo son!


Mi XProfan
Privado Noticias
Eigenes Ablageforum
Temas-Merkliste
Eigene Beiträge
Eigene Temas
Zwischenablage
Cancelar
 Deutsch English Français Español Italia
Traducciones

Política de Privacidad


Wir uso Cookies sólo como Session-Cookies wegen el technischen Notwendigkeit y en uns hay no Cookies de Drittanbietern.

Wenn du hier en unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung de Informationen en unseren Cookies en XProfan.Net a.

Weitere Informationen a unseren Cookies y dazu, como du el Kontrolle darüber behältst, findest du en unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Yo möchte no Cookie