| |
|
|
 Jörg Sellmeyer | Entweder funktioniert hier qué no oder Yo übersehe qué. Der Code es 1:1 de el Ayuda. Er se ejecuta problemlos. Wenn Yo aber una el ForEach-Abfragen en un Procedimiento packe, hay una Fehlermeldung: Variable no deklariert. Dabei se entonces el Hash-Array angemeckert.
cls
declarar cadena key, value
declarar hash person[]
Proc Anzeige
ForEach person[], key, value
imprimir str$(&bucle) + ": " + key + " = " + value
EndFor
ENDPROC
person["A","Vorname"]="Hans"
person[2,"Name","Hugo","X","Y"] = "Mustermann"
person["2","Geburtstag"] = "01.01.01"
person[4.5,"Wohnort"] = "Musterstadt"
person[2,"Alter"] = 34
person["A","Vorname","Test"] = "Hugo"
'ForEach person[], key, value
'
' imprimir str$(&loop) + ": " + key + " = " + value
'
'EndFor
'
Anzeige()
Imprimir
ForEach person[2], key, value
imprimir str$(&bucle) + ": " + key + " = " + value
EndFor
imprimir
ForEach person["A","Vorname"], key, value
imprimir str$(&bucle) + ": " + key + " = " + value
EndFor
Imprimir
Imprimir "Fertig!"
waitinput
end
|
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 09.11.2015 ▲ |
|
|
|
|
 E.T. | probier veces:
y hangle dich entonces por el Fehlermeldungen 
Könnte al Leerzeichen scheitern
ähm.. ForEach ?? |
|
|
| Grüße aus Sachsen... Mario WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte... | 09.11.2015 ▲ |
|
|
|
|
 Jörg Sellmeyer | Usted scheinst no bastante en el Laufenden a ser, lo que el xprofane Desarrollo angeht, oder? Hash son el neuen assoziativen Arrays. Como ya geschrieben: el Code es de el Ayuda y se ejecuta auch. Nur si yo el Proc einbauen, como oben, hakt lo. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 09.11.2015 ▲ |
|
|
|
|
 H.Brill | Como scheint wohl qué no a stimmen. Wenn Yo el Hash-Array como Parámetro übergebe, se lo erkannt, entonces pero probablemente key y value no. Diese son aber auch GLOBAL definiert.
Tal vez erliegen Jörg y yo en efecto una fatalen Irrtum. Andernfalls necesario wir en Rolands Antwort warten. |
|
|
| Benutze XPROFAN X3 + FREEPROFAN Wir sind die XProfaner. Sie werden von uns assimiliert. Widerstand ist zwecklos! Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.
Was die Borg können, können wir schon lange. | 09.11.2015 ▲ |
|
|
|
|
 Jörg Sellmeyer | Yo habs grad getestet: si yo en el Procedimiento key y value ebenfalls definiere, funktioniert lo como gewünscht. Ob el así vorgesehen es?  |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 09.11.2015 ▲ |
|
|
|
|
 | ForEach debería lo egal ser, solange key y value como Variables sichtbar son. Yo schätze como debería una Actualización her. |
|
|
| |
|
|
|
 Jörg Sellmeyer | Hay sí no sólo el beiden Stringvariablen. Das Hash-Array selber se sí no en el Procedimiento erkannt. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 09.11.2015 ▲ |
|
|
|
|
 RGH | Como scheint se una Bug en ForEach versteckt a haben. Natürlich debería lo auch con globalen Variables trabajo. (Auch si globale Variables prinzipiell a vermeiden son. Je größer el Projekt, desto größer el Ärger, el ellos en Pflege desselben hacer. Yo spreche de Erfahrung!)
Vorerst como Workaround: Variables para ForEach como Parámetro transferencia!
Saludo Roland |
|
|
| XProfan X2Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 09.11.2015 ▲ |
|
|
|
|
 RGH | Yo habe nachgeschaut: Yo habe lo tatsächlich así programmiert, dass ForEach (y For) sólo lokalen Variables funktioniert, wobei en el Hauptprogramm el globalen Variables sí lokal son.
Das kann Yo en el nächsten Actualización natürlich ändern ...
Saludo Roland |
|
|
| XProfan X2Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 09.11.2015 ▲ |
|
|
|