[Features] To execute the program.
[Format] RUN ["Filename"],[|i or c|]
To execute the program.
If 'i' is specified, it runs in interpreter execution mode.
If 'c' is specified (& omitted), it runs in intermediate code compile execution mode.
All variables are initialized by execution. Opened files are closed.
If "Filename" is specified, to load the file.
The files saved in ".bin" format,
it can run from intermediate code by [ run"*.bin" ]. (cf.:save)
When execute ".bin" file, the current program which is being edited is cleared.
[e.g.] run ,i
(The Terminal has to be power-on state)
If specify Timer, to launch the Basic at the specified time,
and run the specified program.
Timer is number of milliseconds unit,
it's specified by using 'ex_time' function.
The current time(millsec) can be acquired with 'ex_time(date$,time$)'.
Can be add the time by adding '1second=1000'.
'ex_time' func also be able to operate and convert of time,
please refer also to those item.
".bas" & ".bin", be able to reservation-execution both types.
When receive new reservation during reservation already,
the previous reservation will be overwritten by new one.(old disappear)
By describing 'run'reservation and 'system'command-end in reservation program,
'Regularly consecutive reservation' and recursively-run is possible.
'sp_demo is executed at 12:05 on May 2.
'to launch every 24 hours every day and notify the date.
'('1000*60*60*24' express 1day in milliseconds)
100 ' "self.bas"
110 run "self.bas",,ex_time(date$,time$))+1000*60*60*24
120 ui_msg date$
[Features] Program is ended.
Opened files are closed.
[Features] Program is stopped.
[Features] To continue program after a break.
It uses in a direct statement.
If a program line is modified, or after it was stopped in user definition function,
'cont' will be invalid.
[Features] To delete all the program.
Opened files are closed.
Variable is initialized.
[Features] To list a program to the screen.
[Format] LIST [line number][-][line number]
While the screen touch, it switch to slow scroll mode.
[Features] It goes to edit mode.
[Format] EDIT line-number
Program can be edited by cursor movement and scroll.
It escapes from the mode by stop-key or cls-key.
[Features] To delete program lines.
[Format] DELETE [line number][-][line number]
[Features] It goes to auto line edit mode.
[Format] AUTO [line number][,increment] (Default[100,10])
In editor, auto number line is made, whenever enter is pressed.
It will be canceled if a stop key is pressed.
It begins from the specified number, and increases every increment number.
[Features] To renumber program lines.
[Format] RENUM [new number][,old number][,increment] (Default[100,,10])
It will be renumbered from new number by increment step.
If old number is specified, it will consist of the position of a program.
If omitted, it will consist of heads.
'go'(jump line number) also be rewritten.
[Features] The program lines hit to a word is displayed.
[Format] SEARCH "word"
[Features] To replace character strings of the program.
[Format] REPLACE "string1","string2"
'string1' in source code is replaced to 'string2'.
The replaced line is displayed by listing.
The small and capital letter is distinguished.
[e.g.] To change the variable name in a lump.(an->a10)
30 print a10
[Features] Program is loaded from main storage or SD card.
[Format] LOAD "filename"[,encode]
Opened files are closed.
As for an extension, ".bas" is generally used.
The file no linenumbers also, can be read with assignment linenumbers automatically.
In that case, it cann't run unless in the 'BASIC'.
When loading, duplication check of line number is also performed.
In case of duplication, duplicate line number list will be displayed.
Please correct duplication lines in TextBox mode.
"file name" is 'http:' 'https:' when starting, it loads from the address of the Internet.
When encoding was omitted, "UTF-8" is specified.
For internet file 'http:.../name.bas', when the end of line is ended by a number,
it is necessary to be had modify that it adds 1 space at the end of line.
20 print 123 (<-Because it terminate in the number, space is added at the end of line.)
In the SAVE statement with i option, the file of this format is generated automatically.
[Features] Program is saved to main storage or SD card.
[Format] SAVE "filename" [ , n | i ]
An extension is generally saved by ".bas".
When saved with 'n' option, it is saved without line number.
When saved with 'i' option, it is saved with modified file to it can load from the Internet.
(When the end of line is a number, one space is added to the line end.
And if there are numbers by 'rem, it will enclose by "")
If extension is set to ".c", basic grammar is converted to the C language, and saved.
For more information about details of conversion, please look at here of homepage.
If extension is set to ".bin", it's saved by the intermediate code form.
This form, it can be executed by [ run"*.bin" ].
(In load dialog, the only ".bas" form files are displayed,
The files of All can be viewed in the 'files' command)
Notes in the ".bin" save form
'if' command to the line top.
50 locate 1,2:if a=1 then print 2
In this way, if there are described command before 'if',
please rewrite to the divided line form as follows.
50 locate 1,2
55 if a=1 then print 2
[Features] Program is connected.
[Format] MERGE "filename" [,start-line][,delete-range]
On-memory-program and specified"filename"-program are connected, and it is made one program.
When linenumber overlaps, it is overwritten in the file-side line.
It can be used by both in direct execution and a program.
When the 'delete-range' is specified, it is connected after the line deletion of the range.
Specification e.g.: 500 -330 270-720 1000- (Label disabled)
The difference with 'delete' statement,
even if the designated line don't exist, it don't become the error.
It is that all the line in the range of that number be deleted.
If 'start-line' is specified, it will be resumed from the linenumber.
When it omits, it is resumed from the line located in the next place of 'MERGE'.
Resumption, the variables are passed all.
In (,c)mode, the 'MERGE' statement can describe only one in the program.
[Features] List undisplayed section is specified.
[Format] UNLIST [Hed-Endline] [,Back-Startline]
Undisplayed section can't be edited.
Execution is performed as usual.
UNLIST Unspecified - The specified area is released.
Even if specification line doesn't exist, it doesn't become an error.
[Back-Startline] After this point will be hidden.
Mainly, it is the area which User-defined functions are placed.
The functions here can be called from visible portion.
It can treat as library by hiding User functions.
The library function is loaded previously,
and Main program been 'merge' to visible portion.
[Hed-Endline] Before this point will be hidden.
Mainly, It is used to declare global variables-Arrays used in the function,
and to call the initialization routine backward.
The command affected by 'UNLIST'.
-LIST EDIT SEARCH REPLACE
These are executed only to visible portion.
Only visible portion be saved.
Only visible portion be changed.
When change line attains to undisplayed section,
it becomes an error and doesn't execute.
If there is 'goto' or jump point -(except label) in undisplayed section,
it will not work properly.
All the original source will be erased.
The specified area of 'unlist' is released.
[e.g.] MERGE & UNLIST Sample
20 dim dt(10)
40 unlist 99,1000
50 merge"p1.bas",100,100-999:'only once
60 '--Forward border--
1000 '--Backward border--
1010 func initf()
1020 for i=0 to 7:dt(i)=i*pi:next
1040 func sec(x)
1060 endfunc rt
100 print sec(2)
[Features] List or Text-file is printed by a printer.
[Format] LLIST [TextFileName]
When a Text-file is specified, the text is printed.
What can be specified are [.txt .bas .sql] file.
When not specified, to print the present List.
The size of character to print is specified with 2nd parameter of 'font' command.
The number is from 1 to 7, 7 is max. Default is 2. (c.f. font)
When text is garbled, to specify the encoding by 'init' command as follows.
(The example is UTF-16 specification)
In order to print, it is needed the printer
which have wireless Wi-Fi function supported to Android.
A model of Android 4.4 or higher is required.
(There are some not corresponding, custom ROM etc)
Procedure to print [LLIST,HARDC-common]
Install and run the special-app, driver (provided by printer manufacturer) from GooglPlay.
Turn on the wireless(Wi-Fi,Tethering) of printer or Android, make both sides connection state.
(Because there are each method for each model, please refer to each manual)
Please select Android setting>printing, and turn on printing service.
With this if it is ready for printing, to execute command [LLIST, HARDC] from Basic.
Then, setting dialog screen of printing will open,
please make various settings. (Printer select, Paper size, color, direction etc)
To check the preview screen and press print button to start printing.
(When background is black, it may be replaced by white on the preview side)
The program side don't proceed to the next command until the print dialog is closed.
Notes: [Printer compatibility, connection method, support-app usage, printing quality] etc,
about the portion depending on each printer manufacturer,
please understand that app side can not respond to inquiries.
The print function of Basic manual.
It's possible to print the Basic manual by this description.
This number part, two-digit number including 0. range: 01～26.
Each number, start with [1.operation], from the top, it corresponds in order.
[Features] Screen or Image-file is printed by a printer.
[Format] HARDC [ImageFileName]
When a Image-file is specified, the picture is printed.
What can be specified are [.png .jpg .jpeg] files.
When not specified, to print the hard copy of screen.
And when "scrn:" is specified, it isn't printed and
save the screen to "ScreenShot01.png" as screenshot.
(It doesn't include top status bar and under home button etc)
[Features] To execute the External application.
[Format] EXEC "App-name or [package+class name]"
When application name is specified,
package name and class name are searched and performed automatically.
What was not found is not performed.
What Package and Class name is known beforehand, it can be performed by directly specifying.
The Package+Class name is expressed by alphanumeric characters and period-separated.
When External application is finished, It return to Basic.
'Performs by application name.
'Performs by Package+Class name.(Beginning in capital letters'LaunchActivity' is class name)
[Features] BASIC is ended and returns to OS.
[Features] Simulate and generate an error of specified number.
[Format] ERROR n
|TRON / TROFF|
[Features] To go into Step-execution-mode with display of line number and command.
It is displayed in the form of [command]-lines on upside bar.
Command progresses for every step by touching a screen.
Combined use with variable table editing is possible.
This command works only interpreter mode.
The mode is canceled even if 'new','load'commands is executed.
[print a] 200 a=120:print a:b=240:print b
[Features] To perform various setting of the following kind by Setting-Type.
[Format] INIT "Setting-Type:Set-Value"
init"KB:n" The Keyboard input type is selected.
n=0 For the Hardware keyboard.
n=1 Software keyboard of System.
n=2 Exclusive use AB Software keyboard.
n=3 Virtual device.
[e.g.] init "kb:1"
Menu-setting is changed from program command.
This change is effective only during program execution,
at simultaneous with end, it return to original setting.
ItemChar -it can configure with multiple.
m Language. 0:eng 1:jp
l Locate mode. 0:xy 1:yx
k Input mode. 0:rep-on 1:rep-off 2:flick 3:aux 4:ins-ed
b Key Click SE. 0:on 1:off
u Print Using. 0:doll 1:yen
s Strage location. 0:inter 1:sd
g GLine Antialias. 0:off 1:on
c ColorSet(16) Compatible. n:0~5
[File operation lock.]&[Device access lock.] can't be changed by program because of security.
[Font size.] Please change font size from 'font' command.
'It set to SE-off, Antialias-on, ColorSet-3.
init"ENC:Character encoding type"
Encoding used by [ LOAD, SAVE, (OPEN) PRINT#, INPUT# ] is specified.
Because the encoding by the Web information acquisition is given
in the second parameter of [LOAD,INET$()], It is distinguished from this setup.
[e.g.] The example which changes a UTF-8 file into UTF-16 file.
init"ANGLE:RAD or DEG"
To set the unit of angle, Radian or Degree,
that used in 'sin','cos','tan' and return value of 'atan'.
The default is Radian.
'The following, it will be treated in units of 360 degree.
[Features] The definition of the function key string.
[Format] KEY keycode-No,"string"
The output(inserted) string which the key pressed after Fn key is defined.
For keycode-No, please refer to the table later in the manual.
The keys which can be defined is alphabet keys and number keys.
'Define the 'i'key to "input".
[Features] The list of the contents of defined function keys are displayed.
In the initial state, function keys are defined as follows.
F(34) "for "
G(35) "goto "
I(37) "if "
P(44) "print "
T(48) "then "
L(40) "locate "
W(51) "while "
D(32) "delete "
O(43) "open "
S(47) "search "
Q(45) "sql "
C(31) "case "
K(39) "key "
0(7) "load "http://androidbasic.ninja-web.net/sp/"
(for sample load)