Author Topic: Possible Bugs  (Read 17007 times)

dons333

  • Guest
Possible Bugs
« on: November 04, 2010, 09:45:39 PM »
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

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: Possible Bugs
« Reply #1 on: November 05, 2010, 10:54:46 AM »
Don,

This works for me.

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