File: input_numeric_test.kbs

package info (click to toggle)
basic256 2.0.99.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,888 kB
  • sloc: cpp: 17,185; yacc: 4,025; lex: 1,466; java: 1,091; sh: 39; xml: 33; makefile: 20
file content (34 lines) | stat: -rw-r--r-- 821 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# test numeric input
# 2009-11-01 j.m.reneau
print "input with prompt to numeric variable"
loop:
input "input a number (>100 stops) ", a
print "You entered " + a
if a < 100 then goto loop
#
print "input with prompt to numeric array"
dim b(10)
loop2:
input "input an index 1--10 ", i
if i < 1 or i > 10 then goto loop2
input "input a number (>100 stops) ", b[i]
print "You entered " + b[i]
if b[i] < 100 then goto loop2
#
print "input without prompt to numeric variable"
loop3:
print "input a number (>100 stops) "
input a
print "You entered " + a
if a < 100 then goto loop3
#
print "input without prompt to numeric variable"
loop4:
input "input an index 1--10 ", i
if i < 1 or i > 10 then goto loop4
print "input a number (>100 stops) "
input  b[i]
print "You entered " + b[i]
if b[i] < 100 then goto loop4
#
print "done"