Page 180 - The Ultimate Palm Robot
P. 180
Color profile: Generic CMYK printer profile
Composite Default screen
Bots /The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 7
Chapter 7 Essential Robot Programming Strategies 163
Command Description
msgbox(message$) Displays a message dialog box with a message string and an OK
button. The text message will word-wrap up to two lines. You can
force line wrapping up to three lines by embedding chr$(10) chars
in the message$ string.
msgbox(message$, title$) Displays a message dialog box with a message string, the given
title, and an OK button.
msgbox(message$, title$, n) Displays a message box with a message string and title. If n = 2,
display OK and Cancel buttons; otherwise, display an OK button.
print a,b Display a and b in a message box, similar to the msgbox subroutine.
Provided for backwards compatibility with older versions of
HotPaw Basic. New programs should use msgbox.
? Same as print command. Provided for backwards compatibility with
older versions of HotPaw Basic. New programs should use msgbox.
print at x,y Sets print-to-window-mode for all following print statements. To
turn off print-to-window mode (in other words, to print in message
box mode), use print at -1,0.
input$( prompt$ ) Displays an input dialog box with the given prompt.
input$(prompt$, title$) Displays an input dialog box with the given prompt and title.
input$(prompt$, title$, Displays an input dialog box with the given prompt, title, and
default$) default value.
input$(prompt$, title$, n) Displays an input dialog box with the given prompt and title. If n =
1, only display OK button; if n = 2, display both OK and Cancel.
val(string$) Converts a string to a number. Thus, you can read a number
entered by a user with n = val(input$(...)).
inputbox(...) Same as input$(...).
input$(1) Waits for one graffiti char or button press.
form(9,n,title$) Displays n line 2 column form. Valid values for n are 2 to 9. HotPaw
has a built-in string array s$. The first column of the form displays
the strings at the even numbered indexes of s$ as labels. That is,
s$(0), s$(2), up to s$(16) can be set with string values, and these
values are the labels displayed in the first column of the form. The
second column of the form accepts values entered by the user. Default
values for each line of the form are held in the odd numbered indexes
of s$. That is, s$(1), s$(3), up to s$(17) hold the default values
displayed in column 2 of the form. The values entered by the user
are also stored in s$(1) through s$(17). The form also has four buttons:
OK, Cancel, A, and B. The return value of the form when the user
taps a button is 1 for OK, 2 for the A button, 3 for the B button.
form(0) Returns last dialog box button status and clears the button status to 0.
Table 7-1
Some of the More Common or Useful HotPaw Functions
P:\010Comp\Bots\880-6\ch07.vp
Monday, May 12, 2003 4:29:22 PM