Help for HotPaw Basic for iPhone/iOS version 1.5.5
HotPaw Basic is a Classic BASIC language
interpreter. Line numbers are required to
enter and edit programs. You can edit
a numbered line by using the "edit" command.
(Please scroll this Help text to see more.)
Type "help website" for more complete info.
Commands and Statement Keywords:
run new list del save load removefile
let if then else endif dim data read restore
for to step next while wend goto gosub return
? print input open close end stop
def fn mat randomize cls : rem
Functions:
int() abs() sgn() rnd()
sqr() exp() log() log10() sin() cos() tan() atn()
len() val() asc() str$() chr$() hex$() mid$()
ucase$() lcase$() right$() left$() field$() instr()
eval() varptr() peek() timer() date$ time$ pi
Operators:
+ - * / mod ^
= <> > >= < <= and or xor not
Other special functions and commands:
edit { line_number }
dir
removefile { filename$ }
fn emailfile(address$, subject$, filename$)
fn web(url$)
fn vibrate()
fn solve1()
sound f,d,v : rem frequency, seconds duration, volume(0..99)
morse m$ : rem plays morse code sounds
fn fontsize(x) :' changes console font size
Graphics:
(This version limits graphics to the view above the keyboard.)
moveto x,y
lineto x,y :' draws a line to x,y
fn linewidth(w)
graphics color r,g,b
graphics fillrect x1,y1,x2,y2
fn plot1()
fn touch(1) :' x location in graphics display
fn touch(2) :' y location in graphics display
graphics cls :' clears graphics display
cls :' clears both text and graphics
On iOS AirPrint enabled devices, you can print by using:
open "lpt1:" for output as #1
close #1 : rem print starts after file close
Hints, Notes and Limitations:
String variable names must end with a
$ character.
Arrays must be dimensioned before use.
Input is line input. Only one variable
is allowed per input statement.
Function subroutines with return values are
not supported.
New commands:
edit .
:' Allows multi-line program editing.
graphics circle r
:' Draws circle at previous moveto location
New functions:
dim a(8) :' create an array for GPS data
fn location(1,a(0))
:' Reads location in array a ( time, long, lat, alt, err )
:' Returns time stamp (it's old data if unchanged)
fn location(0)
:' Stops GPS polling
dim a(8) :' create an array for motion data
fn accelerometer(1,a(0))
:' Reads accelerometer into array a (time, x, y , z)
:' Returns time stamp (it's old data if unchanged)
fn accelerometer(0)
:' Stops Accelerometer polling
dim b%(65536) :' required array size
fn recordaudio(64,b%(0))
:' Continues filling array b% with audio samples.
:' Returns index of latest sample
fn recordaudio(0)
:' Stops audio recording
Hints:
Use quotes around filenames with load/save.
If you quit without saving a modified program,
it's saved automatically in the file "tmp.bas".
You can use fn emailfile() to email programs
and files to yourself to save them on your PC.
There are a few other, more advanced commands
documented on the HotPaw website:
http://www.hotpaw.com/basic/iphone
or type "help website" into the console.
1.5.5
added functions for reading accelerometer and location
added a function to read mic input into an array
added a new edit mode
added a graphics circle command
fixed a matrix scaling bug
1.5.3
added mat read command
fixed mat command matrix multiply
fixed a print tab() bug
1.5.2
fixed bug with printing the last line
added fn getclipstr()
Version 1.5.1 - Universal/iPad iOS 4.2 version
Version 1.0.8(365b0i0) - original release
Copyright 2008,2010,2011 HotPaw Productions
portions Copyright 1994,2000 Ronald H Nicholson Jr.
No warranty of functionality, fitness or
usefulness for any purpose whatsoever is
implied.
---