File: testsuite_function_include.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 (40 lines) | stat: -rw-r--r-- 868 bytes parent folder | download | duplicates (2)
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
35
36
37
38
39
40
# testsuite_function_include section for BASIC256

# Modification History
# date		programmer	description
# 2017????	j.m.reneau	split from main testsuite

currentsuite = "function"

function funone(a, b, c$, d$)
   # old way of returning (prev to 0.9.9.21)
   a *= 2
   funone = a + b
   c$ = funtwo$(ref(b), ref(d$))
end function

function funtwo$(r, s$)
   r *=3
   s$ += s$
   return "squiggy"
end function

subroutine subone(a, b$)
   # set globals
   globala += a
   globalb$ += b$
end subroutine

global globala, globalb$
globala = 99
globalb$ = "globalb"
call subone(1,"foo")
call n("globala=100 after sub",globala,100)
call s("globalb$='globalbfoo' after sub",globalb$,"globalbfoo")

a = 9
b$ = "hi"
c = funone(7, ref(a), "junk", ref(b$))
call n("return from funone",c,23)
call n("a=27 return from funone",a,27)
call s("b$='hihi' return from funone",b$,"hihi")