Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Question about reading Data?
#1
It is a very simple question but I am unable to solve the problem. I have a data that holds these values:

inside a While AddItem I have a read dat, but it only is reading -1.


Code:
While AddItem(Objects())
   Restore MyValues
   Read dat(iCounter)
   NPrint dat(iCounter)
   If dat(iCounter)=-1 Then GoTo Skipping
.....
Skipping:
   iCounter=iCounter+1
Wend


MyValues:
Data -1,-1,-1,-1,16

When I run the program instead of getting -1,-1,-1,-1, 16...I am getting -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1.....all the way up to 59th -1. It is inside a loop that holds 59 items. I am Ok with the rest of them being -1...what I am not going that there is no 16 in the list. It is as if...and it is true...it is as if...it is reading only the first value from Data which is -1...then repeating that same first value 59 times.
Zitieren
#2
Because you "restore" to MyValues within the loop.
Zitieren
#3
Thanks Big Grin
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste