ScriptBasic
May 22, 2012, 02:04:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Registration Disabled Send an e-mail to support @ scriptbasic.org to request a membership to this forum. (include desired forum name)
 
   Home   Wiki Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Possible Bugs  (Read 624 times)
dons333
Newbie
*
Posts: 4


« 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

Logged
support
Administrator
*****
Posts: 409


« Reply #1 on: November 05, 2010, 10:54:46 AM »

Don,

This works for me.

Code:
a[1]=""
WHILE a[1] <> "x"
  LINE INPUT a[1]
  a[1]=CHOMP(a[1])
WEND
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!