PocketC 1 [3.61] BASIC I/O puts(string text) print string, use \n for newline --- gets(string prompt) dialog box, use \r for newline --- getsd(string prompt, string defaultValue) dialog box with default, use \r for newline --- getsi(int x, int y, int w, string defaultValue) minidialog at x,y location and pixel width w --- alert(string msg) message box --- confirm(string msg) Confirm box - Returns 1 for Yes, 0 for No. --- clear() clears the output form. EVENT SYSTEM event(int blocking) blocking=0 returns immediately, blocking=1 blocks, blocking>1 wait in 100ths of second. Events are as follows: 0:none, 1:key (character), 2:penDown, 3:penUp, 4:penMove, 5:pageUpKey, 6:pageDownKey, 7-10:hardKey1-4, 11:menuEvent. (last two need hooks) --- key() retrieve the character written during the last event() --- penx() retrieve the x value of the pen event processed by the last call to wait, waitp, or event. --- peny() retrieve the y value of the previous pen event. --- pstate() returns 1 if the pen in down, 0 otherwise. --- bstate() returns the state of the hard buttons. Returns 0:neither, 1:page up, -1:page down. --- wait() wait for a pen or character event. Returns the character written to the graffiti area or -1 for pen event- use key() or penx()/peny() to retrieve --- waitp() wait for a pen event. Use penx() and peny() to retrieve the location of a pen event. --- getc() wait for and return a character written to the graffiti area. --- hookhard(int bHook) if bHook is nonzero, hard keys (address button, etc.) are not processed by the OS. --- hookmenu(int bHook) if bHook is nonzero, menu silkscreen button is not processed by the OS. GRAPHICS graph_on() switches to the graphics form. --- graph_off() switches from the graphics form to the output form. --- text(int x, int y, string str) display a string str at locations (x,y). --- textattr(int font, int color, int underline) set the current text drawing attributes. Available fonts are normal[0], bold[1], large[2], symbol[3], symbol11[4], symbol7[5], LED[6], Large Bold[7] (OS 3.0 only). Available colors are white[0], black[1], inverted[2]. Underline modes are none[0], solid[1], dotted[2]. --- textalign(char alignmentYX) sets the alignment that text() uses. The parameter is a number between 0 and 22, where the first decimal digit describes the vertical alignment, and the second describes the horizontal. left[0], center[1], right[2]. --- textwidth(string str) returns the pixel width of str --- line(int col, int x1, int y1, int x2, int y2) draws a line from (x1, y1) to (x2, y2) in color col. white[0], black[1], gray[2], XOR[3]. --- rect(int col, int x1, int y1, int x2, int y2, int radius) draws a rectangle from (x1, y1) to (x2, y2) in color col with corners of radius radius. A radius of 0 has square edges. white[0], black[1], XOR[3]. (This function doesn't support gray) --- frame(int col, int x1, int y1, int x2, int y2, int radius) same as rect() but not filled. white[0], black[1], gray[2], XOR[3]. --- frame2(int col, int x1, int y1, int x2, int y2, int radius, int width) same as frame() but allows specification of width (1-3 only). --- title(string title) set the graphic form title to title. --- clearg() clear the graphics form. --- saveg() save the graphics form internally. Returns 0 on failure, 1 otherwise. --- restoreg() restore the graphics form previously saved by a call to saveg(). This can only be called once for each time saveg() is called. --- bitmap(int x, int y, string bits) draw a bitmap at (x,y). The bits string is a list of hexadecimal digits in the following form: "wwxxxxxxxx..." where 'ww' is the width of the bitmap (i.e. '0a' is a 10-pixel wide bitmap), and 'xxx...' are the bits of the bitmap, each character representing 4 pixels. So, "0affc804804ffc" is a 10x4 bitmap of a rectangle ('ffc' is a solid line, '804' represents a left and right edge.)