ScriptBasic Users Guide
by Peter Verhas
Table of Contents
1. Introduction
2. Using ScriptBasic
3. Installation Instructions
4. Code caching
5. Compiling BASIC programs
6. Compiling BASIC program to EXE
7. Compiling BASIC programs to C
8. Compiling ScriptBasic with modules
9. General Language Format
10. Interacting with the user
11. Name spaces
12. File Handling
13. Networking
14. String handling commands
15. Conditional Execution
16. The statement GOTO
17. Loop constructs
18. Functions and Subroutines
19. Reference Variables
20. Pattern matching
21. Handling run-time errors
22. Setting options
23. Other miscellaneous commands
24. Using External modules
25. Command reference
25.1. ABS
25.2. ACOS
25.3. ACOSECANT
25.4. ACTAN
25.5. ADDDAY
25.6. ADDHOUR
25.7. ADDMINUTE
25.8. ADDMONTH
25.9. ADDRESS( myFunc() )
25.10. ADDSECOND
25.11. ADDWEEK
25.12. ADDYEAR
25.13. ASC(string)
25.14. ASECANT
25.15. ASIN
25.16. ATAN
25.17. ATN
25.18. BIN
25.19. BINMODE [ # fn ] | input | output
25.20. CALL subroutine
25.21. CHDIR directory
25.22. CHOMP()
25.23. CHR(code)
25.24. CINT
25.25. CLOSE [ # ] fn
25.26. CLOSE DIRECTORY [#] dn
25.27. COMMAND()
25.28. Concatenate operator &
25.29. CONF("conf.key")
25.30. COS
25.31. COSECANT
25.32. COTAN
25.33. COTAN2
25.34. CRYPT(string,salt)
25.35. CURDIR()
25.36. CVD
25.37. CVI
25.38. CVL
25.39. CVS
25.40. DAY
25.41. DECLARE COMMAND function ALIAS cfun LIB library
25.42. DECLARE SUB function ALIAS cfun LIB library
25.43. DELETE file/directory_name
25.44. DELTREE file/directory_name
25.45. DO
25.46. DO UNTIL condition
25.47. DO WHILE condition
25.48. END
25.49. ENVIRON("envsymbol") or ENVIRON(n)
25.50. EOD(dn)
25.51. EOF(n)
25.52. ERROR() or ERROR n
25.53. ERROR$() or ERROR$(n)
25.54. EVEN
25.55. EXECUTE("executable_program", time_out,pid_v)
25.56. EXIT FUNCTION
25.57. EXIT SUB
25.58. EXP
25.59. FALSE
25.60. FILEACCESSTIME(file_name)
25.61. FILECOPY filename,filename
25.62. FILECREATETIME(file_name)
25.63. FILEEXISTS(file_name)
25.64. FILELEN(file_name)
25.65. FILEMODIFYTIME(file_name)
25.66. FIX
25.67. LOCK # fn, mode
25.68. FOR var=exp_start TO exp_stop [ STEP exp_step ]
25.69. FORK()
25.70. FORMAT()
25.71. FORMATDATE
25.72. FILEOWNER(FileName)
25.73. FRAC
25.74. FREEFILE()
25.75. FUNCTION fun()
25.76. GCD
25.77. GMTIME
25.78. GMTOLOCALTIME
25.79. GOSUB label
25.80. GOTO label
25.81. HCOS
25.82. HCOSECANT
25.83. HCTAN
25.84. HEX(n)
25.85. HOSTNAME()
25.86. HOUR
25.87. HSECANT
25.88. HSIN
25.89. HTAN
25.90. ICALL n,v1,v2, ... ,vn
25.91. IF condition THEN
25.92. IMAX
25.93. IMIN
25.94. INPUT(n,fn)
25.95. INSTR(base_string,search_string [ ,position ] )
25.96. INSTRREV(base_string,search_string [ ,position ] )
25.97. INT
25.98. ISARRAY
25.99. ISDEFINED
25.100. ISDIRECTORY(file_name)
25.101. ISEMPTY
25.102. ISINTEGER
25.103. ISNUMERIC
25.104. ISREAL
25.105. ISFILE(file_name)
25.106. ISSTRING
25.107. ISUNDEF
25.108. JOIN(joiner,str1,str2,...)
25.109. JOKER(n)
25.110. KILL(pid)
25.111. LBOUND
25.112. LCASE()
25.113. LCM
25.114. LEFT(string,len)
25.115. LEN()
25.116. v = expression
25.117. v &= expression
25.118. v /= expression
25.119. v \= expression
25.120. v -= expression
25.121. v += expression
25.122. v *= expression
25.123. string LIKE pattern
25.124. LINE INPUT
25.125. LOC()
25.126. LOCATLTOGMTIME
25.127. LOCK # fn, mode
25.128. LOCK REGION # fn FROM start TO end FOR mode
25.129. LOF()
25.130. LOG
25.131. LOG10
25.132. LTRIM()
25.133. MAX
25.134. MAXINT
25.135. MID(string,start [ ,len ])
25.136. MIN
25.137. MININT
25.138. MINUTE
25.139. MKD
25.140. MKDIR directory_name
25.141. MKI
25.142. MKL
25.143. MKS
25.144. MONTH
25.145. NAME filename,filename
25.146. NEXTFILE(dn)
25.147. NOW
25.148. OCT(n)
25.149. ODD
25.150. ON ERROR GOTO [ label | NULL ]
25.151. ON ERROR RESUME [ label | next ]
25.152. OPEN file_name FOR mode AS [ # ] i [ LEN=record_length ]
25.153. OPEN DIRECTORY dir_name PATTERN pattern OPTION option AS dn
25.154. OPTION symbol value
25.155. OPTION("symbol")
25.156. pack("format",v1,v2,...,vn)
25.157. PAUSE
25.158. PI
25.159. POP
25.160. POW
25.161. PRINT [ # fn , ] print_list
25.162. RANDOMIZE
25.163. ref v1 = v2
25.164. REPEAT
25.165. REPLACE(base_string,search_string,replace_string [,number_of_replaces] [,position])
25.166. RESET
25.167. RESET DIRECTORY [#] dn
25.168. RESUME [ label | next ]
25.169. RETURN
25.170. REWIND [ # ]fn
25.171. RIGHT(string,len)
25.172. RND
25.173. ROUND
25.174. RTRIM()
25.175. SEC
25.176. SECANT
25.177. SEEK fn,position
25.178. SET FILE filename parameter=value
25.179. SET JOKER "c" TO "abcdefgh..."
25.180. SET WILD "c" TO "abcdefgh..."
25.181. SIN
25.182. SLEEP(n)
25.183. SPACE(n)
25.184. SPLIT string BY string TO var_1,var_2,var_3,...,var_n
25.185. SPLITA string BY string TO array
25.186. SPLITAQ string BY string QUOTE string TO array
25.187. SQR
25.188. STOP
25.189. STR(n)
25.190. STRING(n,code)
25.191. STRREVERSE(string)
25.192. SUB fun()
25.193. swap a,b
25.194. SYSTEM(executable_program)
25.195. TAN
25.196. TAN2
25.197. TEXTMODE [ # fn] | input | output
25.198. TIMEVALUE
25.199. TRIM()
25.200. TRUE
25.201. TRUNCATE fn,new_length
25.202. TYPE
25.203. UBOUND
25.204. UCASE()
25.205. UNDEF variable
25.206. UNPACK string BY format TO v1,v2,...,vn
25.207. VAL
25.208. WAITPID(PID,ExitCode)
25.209. WEEKDAY
25.210. WHILE condition
25.211. YEAR
25.212. YEARDAY