| |
|
|
Jörg Sellmeyer | then Have so did i same time ne Question whom Hash-Arrays. somehow want which me not yet so right erschließen.
cls
declare string key, value
declare hash person[]
Randomize
WhileLoop 3
key = stature$("0000",Rnd(1000)) + " " + Str $(&Loop)]
print key
person[key] = "Eintrag " + Str $(&Loop)
person[key,"Sub1"] = "Text1 " + Str $(&Loop)
person[key,"Sub2"] = "Text2 " + Str $(&Loop)
person[key,"Sub3"] = "Text3 " + Str $(&Loop)
Wend
print
'without The Eingrenzung on key I get 12 expenses
'i will but only 3 expenses having. with key come but only The expenses the last Eintrags out
ForEach person[key],key,value
Print key,value
Print SubStr$(key,1,"|")
EndFor
'here I get The values each 4x
ForEach person[],key,value
'Print key,value
Print SubStr$(key,1,"|")
EndFor
'here happens garnichts...
Whileloop 0,2
Print person[]
Wend
WaitKey
can I here somehow only the first Bezeichner read? means the, what by chance into aray written watts? or read I always with ForEach everything from and use then SubStr$(), around the first worth To detect? or differently demand: can I the value the first Eintrages read, without whom Bezeichner To kennen?
[OFFTOPIC] David, I faith, You must ForEach time still in The Syntaxerkennung einpflegen... [/OFFTOPIC] |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11/09/15 ▲ |
|
|
|
|
RGH | I try, it time To explain:
You beget in the Hash-aray 12 Entries, where each 4 whom equal first Key (key) and have number 2 To 4 each a others second Key get.
If you now in the first FOREACH any Eintrage with the last worth of Key as first Key auflistest, get You naturally The last four Entries the Arrays displayed.
in the second FOREACH give You none Key as Einschränkung on, means get You any 12 Entries displayed.
(alas Yes: with WHILIELOOP would Perhaps a Error Message appropriate, there one one complete aray not print out can.)
The Hauptzweck one Hash-Arrays exists even therein, that one not over a number (The position in the aray), separate a or several Key (too Hash called) on the Content zugreift.
without further can You means first of all not whom first entry grab, without whom Key To kennen. one can itself but a small Loop basteln, around the entry Nr one Hasharrays auszulesen:
here power one itself whom Umstand To Nutze, that The Systemvariable &loop too with FOREACH (and FOR) intern hochgezählt becomes.
Greeting 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/09/15 ▲ |
|
|
|
|
Jörg Sellmeyer | thanks, I werd it test times. can it his, that You a couple Doppelpunkte in the code forget have?
Ah - its the, I too use wished, in something another shape:
|
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 11/09/15 ▲ |
|
|
|
|
Jörg Sellmeyer | now Have so did i my fallacy seen.
so is it Yes plenty sinnvoller:
|
|
|
| |
|
|