English
Forum

Hash Key read

 

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:
cls
declare string key, value
declare hash person[]
Randomize

WhileLoop 3

    key = stature$("0000",Rnd(1000))' + " " + Str$(& Loop)
    print key
    person["Eintrag" + Str $(&Loop)] = key
    person[key,"Sub1"] = "Text1 " + Str $(&Loop)
    person[key,"Sub2"] = "Text2 " + Str $(&Loop)
    person[key,"Sub3"] = "Text3 " + Str $(&Loop)

Wend

print
ForEach person["Eintrag"],key, value
Print key,value
EndFor
Waitkey
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11/09/15  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.858 Views

Untitledvor 0 min.
E.T.12/09/22
Walter05/10/21
iF12/31/15
rquindt12/30/15
More...

Themeninformationen

this Topic has 2 subscriber:

Jörg Sellmeyer (3x)
RGH (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie