File: input_string_test.kbs

package info (click to toggle)
basic256 0.9.6.69a-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 26,304 kB
  • sloc: cpp: 7,778; yacc: 926; lex: 575; sh: 21; makefile: 7
file content (34 lines) | stat: -rw-r--r-- 813 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 string input
# 2009-11-01 j.m.reneau
print "test input with string and prompt"
loop:
input "input a string ('stop' stops) ", a$
print "You entered " + a$
if a$ <> "stop" then goto loop
#
print "test input with string and array"
dim b$(10)
loop2:
input "input an index 1--10 ", i
input "input a string ('stop' stops) ", b$[i]
print "You entered " + b$[i]
if b$[i] <> "stop" then goto loop2
#
print "test input with string and whthout prompt"
loop3:
print "input a string ('stop' stops) "
input a$
print "You entered " + a$
if a$ <> "stop" then goto loop3
#
print "test input with string and array"
loop4:
print "input an index 1--10 "
input i
if i < 1 or i > 10 then goto loop4
print "input a string ('stop' stops) "
input b$[i]
print "You entered " + b$[i]
if b$[i] <> "stop" then goto loop4
#
print "done"