Open Forum > Round Table

Possible Bugs

(1/1)

dons333:
I have a small segment of code as follows:

 1 print "This program adds times\n"
 2 print "Format HH.MM\n"
 3 print "Enter \"x\" to quit\n"
 4
 5 i = 0
 6 a[ i ] = "a"
 7
 8 while (a[ i ] <> "x")
 9 print "Enter time ", i, " :"
10 line input a[ i ]
11 a[ i ]=chomp (a[ i ])
12 print a[ i ],"\n"
13 strgg = a[ i ]
14 i += 1
15 wend
16
17 for j = 0 to i-1
18   print a[ j ], "\n"
19 next

I added the line numbers for reference. They are omited from the actual execution code.

The while construct on line 8 does not seem to recognize the array script. However, when I substitute a[ i ] with the variable strgg in lines 6 and 8, things work fine. Is this a bug, or did I enter the line wrong?
Thanks, dons333

Support:
Don,

This works for me.


--- Code: ---a[1]=""
WHILE a[1] <> "x"
  LINE INPUT a[1]
  a[1]=CHOMP(a[1])
WEND

--- End code ---

Navigation

[0] Message Index

Go to full version