home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-02-15 | 37.1 KB | 1,039 lines |
- =============================================================================
-
- ---------
- DATA (as in single @, databegin and so on) can have imbedded "-" characters
- so you can have negative numbers or filenames with a "-". This does not mean
- you can have a filename with a "-" outside of a data statement without
- quotes, so:
-
- pload pic-view,1
-
- will still screw up, unless you use:
-
- pload "pic-view",1
-
- BUT!
-
- data pic-view
- pload @,1
-
- will now work.
-
- ---------
- GETMOUSE:
- New command GETMOUSE, is similar to GETKEY. The syntax is:
-
- GETMOUSE VAR1 VAR2 VAR3
-
- The first value is button status, second and third are mouse
- coordinates. The following example draws lines with the mouse when
- a button is pressed:
-
- video a
- color 3
- mouse on
- lp: getmouse but msx msy
- if @but
- dlp: set ox @msx oy @msy
- getmouse but msx msy
- if @but
- line @ox @oy @msx @msy
- goto dlp
- endif
- endif
- goto lp
-
-
- GETMOUSE when no driver installed will not change/setup variable
- values.
- GETMOUSE with last click/release option will return a zero for
- button status if their were no clicks/releases since last check.
-
- ---------
- IFMOUSE when used with reverse box option and a color of 0, will no longer
- pause from drawing a XOR box of color 0 (which does nothing).
-
- =============================================================================
- Page 6
-
- =============================================================================
-
-
- ---------
- Some new commands/variations on old commands:
-
- mouse window x1 y1 x2 y2 ;restrict mouse movement window
- getmouse but x y ;get current mouse position
- getmouse but x y 0 ;get last mouse release button pos
- getmouse but x y 1 ;get last mouse press button pos
-
- ---------
- A new option for MOUSE command sets the current mouse cursor position:
-
- MOUSE POSITION X Y
-
- Another new option for mouse command is mouse sense which lets you set
- the mouse sensitivity and velocity just like in PICTOR. It's syntax is:
-
- MOUSE SENSE ;reset to sens 1, velo 5 (default)
- MOUSE SENSE sens ;set sens only (velo will be set to 5)
- MOUSE SENSE sens velo ;set sens and velo
-
-
- The MOUSE CURSOR command will now accept clipping buffer numbers as well
- as filenames.
-
- ---------
- MOUSE WINDOW with no parms will reset the mouse window to the current WINDOW
- setting, which is the same as:
-
- MOUSE WINDOW @MINX @MINY @MAXX @MAXY
-
- This is to make MOUSE WINDOW syntax consistent with WINDOW syntax.
-
- ---------
- GETCOLOR now supports an optional variable name. If the variable name is
- specified the drawing color will remain unchanged and the variable will
- contain the color at that coordinate.
-
- ---------
- The GETKEY command will now handle Function and ALT keys via 2
- character strings with the second character being chr(1), so a check
- for ALT-M would be:
-
- getkey k
- if @k==chr(50)$chr(1)
- text "you hit ALT-M"
- endif
-
- or you might prefer:
-
- getkey k
- if peekw(adr(@k))==(50|256)
- text "you hit ALT-M"
- endif
- =============================================================================
- Page 7
-
- =============================================================================
-
- A major addition to the getkey command now gives it the option of getting a
- key not by character, but name, so the following would be valid:
-
- getkey key name
- if @key==home
- text "you hit the Home key"
- else
- if @key==ctrl-f1
- text "you hit the f1 key"
- endif
- endif
-
-
- The parm which controls whether the variable will be a ascii value, or a
- key name is the second parm on the getkey command. You need to use the word
- "name".
-
- ---------
- Glib:
-
- There's a new command option in Glib called Move (/M). Like Update
- (/U), it inserts the named files into the library file. Unlike Update,
- it also deletes the files from the directory. For example, the command
-
- GLIB /M MYAPP *.*
-
- would copy all files in the current directory into MYAPP.GL, then
- delete them, leaving only MYAPP.GL. Be careful that you have a backup
- of files in another directory.
-
-
- ---------
- The new command LOAD is used to load .GRP files, and assorted data files such
- as sound. The following two commands are the same:
-
- local grasp readfile(c:\grasp\sound.grp)
- and
- load c:\grasp\sound
-
-
- The LOAD command will only create a new variable if there is no global
- variable of the same name. This is so you can load sound data, and routines
- within a subroutine by making your variables global before using LOAD.
-
- ---------
- A new feature for CALL, LINK and MERGE. They will all accept an address of a
- block of text in place of a filename. Example:
-
- if !def(myfuncs)
- global myfuncs 0
- load myfuncs.txt
- endif
- merge @myfuncs
- link fun
-
- fun.txt:
-
- merge @myfuncs
- =============================================================================
- Page 8
-
- =============================================================================
-
- ---------
- SETUPSCR in mode S on PARADISE based cards has been disabled. This allows
- the sequence:
-
- VIDEO S
- SETUPSCR 1024 480
- WINDOW 0 0 639 479
-
- to work on virtually all SVGAs. Previously, it was not necessary to use the
- SETUPSCR command when developing for a PARADISE system. This was a problem
- if the program was going to be run on any other video system which would
- require the SETUPSCR command.
-
- ---------
- WHEN command:
-
- A WHEN command that calls a subroutine has to use the word GOSUB
- before the subroutine's name. This is the only instance where using a
- subroutine's name alone will not work.
- =============================================================================
- Page 9
-
- =============================================================================
-
- Section 2: Variables and Functions
- ----------------------------------
-
- list of functions:
- ------------------
- abs(), adr(), append(), asc(), chr(), close(), create(), dec(), def(),
- eval(), faralloc(), farfree(), farrealloc(), hex(), in(), left(), len(),
- mid(), ofs(), open(), pad(), peek(), peekl(), peekw(), random(), read(),
- readfile(), right(), seek(), seekgl(), seg(), size(), sqrt(), string(),
- width(), widths(), write()
-
- list of global readable variables:
- ----------------------------------
- cliptext, color, drawpage, elapsed, fontxsize, fontysize, gap, glfs
- maxx, maxy, memfree, memused, minx, miny, mouse, runtime, sgap, sptr,
- textx, texty, txtbuf, txtlen, vgap, viewpage, vmode, wrap, xoff, yoff
-
- list of global SETable variables/options:
- -----------------------------------------
- esc, space, retrace, monospace, xor, quicktext, debug, cgetshift
- center, left, right, abort, msvert, wrap, cliptext, nocli, cgetshift,
- maxcall
-
- =============================================================================
-
- FUNCTIONS:
- ---------
-
- String function:
-
- The function STRING(LENGTH,CHAR) returns a string of the specified
- length filled with the specified character (or filled with the first
- character of CHAR if it's longer than one character). For example,
- this command displays a line of dashes: TEXT STRING(80,"-")
-
- ---------
- Some new functions for expressions are eval(), pad() and dec(). Eval is
- just like eval macro, but much cleaner. Example:
-
- eval(18$"-(5+7)")==18-(5+7)==6
-
- dec() is much like hex except that is has a second parameter which
- is the field width, so:
- dec(67,5)=="00067" and dec(167,1)=="167".
- dec() pads with zero characters.
-
- pad() pads a string with spaces, so: pad("john",10)==" john"
-
- DATIME.TXT is a small example of DEC() and PAD() which displays
- date and time by calling DOS.
-
-
- =============================================================================
- Page 10
-
- =============================================================================
-
- ---------
- Another new function is WIDTH(), it returns the width in pixels of a string
- in the current font. Example:
-
- video m
- under 40 50 "Hi there"
- waitkey
- exit
-
- under: text @1+1 @2+1 @3
- line @1 @2 @1+width(@3) @2
- return
-
- ---------
- New operator is ->. It's called arrow and it lets you get information on a
- picture or clipping buffer. Valid values for the right hand side of the ->
- are:
-
- xsize ;width of a picture/clipping
- ysize ;height of a picture/clipping
- xoff ;X position on screen stored as part of image
- yoff ;Y position on screen stored as part of image
-
- Example:
-
-
- video m
- cent image
- waitkey
- exit
-
- cent: cload @1,1
- putup ((@maxx-@minx)-c1->xsize)/2+@minx$"
- ",((@maxy-@miny)-c1->ysize)/2+@miny,1
- cfree 1
- return
-
- the $" " stuff is how to continue a very long line.
-
- ---------
- A new math function ABS() gives absolute value. As an example, this distx
- function will return the distance in pixels between two X coordinates:
-
- distx:
- return 1+abs(@1-@2)
-
-
- Another new math function SQRT() gives the square root of a number (integer
- result).
-
- ;
- ; DISTANCE X1 Y1 X2 Y2
- ;
- distance:
- local x 1+abs(@1-@3)
- local y 1+abs(@2-@4)
- return sqrt(@x*@x+@y*@y)
- =============================================================================
- Page 11
-
- =============================================================================
-
- ---------
- Function seekgl(fname), will return the size of a file within the .GL which
- is currently open and seek to the beginning of that file. It will return 0
- if the file was not found.
-
- ---------
- An example which uses wrap off, @glfs and seekgl:
-
- set wrap off ;keep original formatting
- opengl fontbug ;open fontbuf.gl
- set ln seekgl(testfast.txt)-1 ;get length of testfast.txt
- readstr @ln ;read whole text file into string
- text @0 ;display testfast.txt
- waitkey
- exit
-
- readstr:
- local buf ofs(string(@1," ")) ;setup dummy buffer to read into
- int 0x21 0x3F00,@glfs,@1,@buf,,,seg(@buf) ;call dos to read data
- return @((seg(@buf)<<16)+@buf) ;return actual data
-
- ---------
- Math function RANDOM() gives random number between two numbers.
-
- text random(1,6)$"-"$random(1,6)
-
- ---------
- A pile of new built in functions have been added, most of them duplicating
- functions found in DOSIO.TXT which is no longer needed.
-
- ---------
- Two critical functions added are FARALLOC which allocates a memory buffer
- and returns a 32 bit pointer to that buffer. Also, FARFREE which frees up
- the space that buffer takes up. That space will automatically be freed up
- when your program exits, but it's best to not make lots of buffers and not
- free them up. An example using new functions is:
-
- set wrap off ;keep original formatting
- opengl fontbug ;open fontbuf.gl
- set ln seekgl(testfast.txt)-1 ;get length of testfast.txt
- readstr @ln ;read whole text file into string
- text @@0 ;display testfast.txt
- . farfree(@0)
- waitkey
- exit
-
- readstr:
- local buf faralloc(@1+1) ;setup buffer to read into
- . read(@glfs,@buf,@1) ;read data from gl file
- return @buf ;return address of actual data
-
-
- =============================================================================
- Page 12
-
- =============================================================================
-
- ---------
- Other new functions are:
-
- fs=open(fname) ;open a file for reading
- fs=create(fname) ;create a new file for writing
- fs=append(fname) ;open a file for reading/writing
- len=size(fs) ;get length of file
- pos=seek(fs,pos,rel) ;seek to a position within file
- len=read(fs,adr,len) ;read a block of data with 32 bit
- ;address
- len=read(fs,seg,ofs,len) ; with seg/ofs
- len=write(fs,adr,len) ;write a block of data with 32 bit
- ;address
- len=write(fs,seg,ofs,len) ; with seg/ofs
- err=close(fs) ;close an open file
- buf=faralloc(size) ;allocate a block of memory
- err=farfree(buf) ;free a block of memory
-
- The period alone can be used to execute functions without doing
- anything with their return value. An example is the ". read(" in the
- given example.
-
- ---------
- New Function READFILE() allows you to pass it a filename and it reads it
- from the currently open GL or currect directory. It returns a 0 if the file
- was not found, otherwise it returns the 32 bit address just like FARALLOC(),
- which can be free'd up with FARFREE(). Additionally, if you use a number for
- a command which exceeds 256, the number will be treated as an address that
- will be called. Some example code which uses this feature:
-
- set lower readfile(lower.grp)
- set upper readfile(upper.grp)
- @lower "Hello There"
- set str @@0
- text @str ;prints hello there
- @upper @str
- text @@0 ;prints HELLO THERE
- . farfree(@lower)
- . farfree(@upper)
-
- ---------
- New function DEF(var) returns a 1 if a variable is defined, and a
- 0 if not. Example:
-
- if !def(john)
- set john 50
- endif
-
- =============================================================================
- Page 13
-
- =============================================================================
-
- ---------
- New function farrealloc() to be used in conjunction with faralloc() and
- farfree(). Farrealloc() is used to change the size of an allocated block of
- memory. An example would be a buffer full of PCM sound which you would like
- to add a digital echo. In order for the echo to continue after the normal
- end of the sound, you would need to extend the length of your sound buffer to
- accomadate the extra data at the end. Farrealloc has the side effect of
- "compacting" memory, even if you resize a block of memory to the same size
- it was already allocated. In fact, if you give a new size of 0, GRASP
- will default to the same size the block has already been allocated.
- Example:
-
- pload john 1
- set buf readfile(david.snd)
- pfade 0 1
- pfree 1
- set buf farrealloc(@buf,0)
- play @buf
- . farfree(@buf)
-
- ---------
- Also added are DELETE() and MOVEMEM.
-
- DELETE() is a new function which deletes a file and returns a zero
- if the delete succeeded.
-
- MOVEMEM is a new command containing 3 parameters; source
- address, destination address and number of bytes to move. Some
- example code to save a picture buffer to a allocated buffer (pretty
- useless, but it's an example of what could be done). With a
- bit more work this could be made to save to EMS.
-
- ...
- savebuf p1
- set save @0
- ...
- restbuf p1 @save
- ...
- exit
-
- savebuf:
- local buf faralloc(@1->size+4) ;allocate buffer
- pokew @buf @1->xsize ;save xsize
- pokew @buf+2 @1->ysize ;save ysize
- movemem @1->adr @buf+4 @1->size ;save image data
- pfree @1 ;free up picture buffer
- return @buf
-
- restbuf:
- pnewbuf @1 peek(@2) peek(@2+2)
- movemem @2+4 @1->adr @1->size
- . farfree(@2)
- return
-
-
-
- =============================================================================
- Page 14
-
- =============================================================================
-
- same code except it saves to disk:
- ----------------------------------
-
- ...
- savebuf p1 tmpfile.tmp
- ...
- restbuf p1 tmpfile.tmp
- ...
- exit
-
-
- savebuf:
- local fs create(@2) ;create temp file
- . write(@fs,adr(@1->xsize),2) ;write ysize to file
- . write(@fs,adr(@1->ysize),2) ;write ysize to file
- . write(@fs,@1->adr,@1->size) ;write image data
- . close(@fs)
- pfree @1 ;free up picture buffer
- return
-
- restbuf:
- local fs open(@2) ;open file with saved data
- local tmp adr("1234") ;create temp buffer to
- ;read x,y
- . read(@fs,@tmp,4) ;read in xsize and ysize
- pnewbuf @1 peek(@tmp) peek(@tmp+2) ;create new picture buffer
- . read(@fs,@1->adr,@1->size) ;read image data into
- ;buffer
- . close(@fs)
- . delete(@2) ;delete old file
- return
-
- ---------
- Address function:
-
- The function ADR(variable) returns a 32-bit address in hex, containing
- both the segment and offset. For example, ADR("myname") might return
- the string "0x287B3E58". In addition, the PEEK functions and POKE
- commands (PEEK, PEEKL, PEEKW, POKE, POKEL, POKEW) can use one 32-bit
- address parameter instead of two 16-bit ones. This approach, however,
- limits you to Poking one value rather than multiple ones. Here's an
- example:
-
- SET POINTER ADR("SHARY") ; put address of string "SHARY" in STRPOINTER
- POKE @POINTER+4 ASC("I") ; write "I" to memory at fifth byte position
- TEXT @@POINTER ; display "SHARY"
- WAITKEY
-
- ---------
- Exclusive OR:
-
- The caret (^) is the exclusive-OR operator. Comparison is bit-by-bit.
-
- =============================================================================
- Page 15
-
- =============================================================================
-
-
- ---------
- New function widths(). This is a VERY specific function which is intended
- for those interested in writing their own text routines. It builds a table
- of character widths for the current font. This is only valid in graphic
- modes. An example of use might be:
-
- video g
- load height ;load height.grp
- @height ;pass height no parms to get address to
- ;store width table
- . widths(@0) ;use width function with address of
- ;array inside loaded height.grp
-
- set xs 50
- set str "Hello there my name is unknown"
- @height @xs @str
- window 1+@maxx-@xs,1+@maxy-@0,@maxx,@maxy
- color 1
- rect @minx,@miny,@maxx,@maxy
- color 14
- text @str
- waitkey
-
-
- The data is 256 bytes of character widths, followed by 4 bytes that are gap,
- vgap, xsize and ysize respectively for the current font.
-
- The height.grp is a C routine which caculates the height of a string in
- pixels given a wrap width. This is very useful for generating a window for a
- block of text whose size is not hardcoded. Please do not complain about how
- round about the code in height.c is, I simply took the text format routine
- from the text command in grasp and stripped out the actual plot code to come
- up with a height calculation algorithm. You will find height.grp and
- height.c in the GRASP subdirectory.
-
- =============================================================================
- VARIABLES:
- ---------
-
- Global variables:
-
- In addition to SET and LOCAL, the GLOBAL command can create variables,
- which can be used by any routine at any level. See the disk file
- CDCMD.TXT (in your GRASP directory) for an example. The command is
- used in the routine CDINIT to set the name of the CD drive.
-
- There is now support for system global variables (read only, they don't
- work with SET). Currently supported ones are:
-
- @minx
- @miny
- @maxx
- @maxy
- @color
-
-
- =============================================================================
- Page 16
-
-
- =============================================================================
-
- ---------
- Return variable:
-
- The return variable @0, which is discussed on page 3-40, is also set
- when a subroutine is called. It's set equal to the subroutine's name,
- which makes it easy to trace program flow when debugging or reporting
- errors. The DOS routine DOSERR uses this feature.
-
- ---------
- Memory and variables:
-
- This example illustrates a peculiarity of memory addressing in
- GRASP. You can't use the obvious method to directly alter variables:
-
- SET X "SHARY" ; put string "SHARY" into variable X
- SET POINTER ADR(@X) ; put address of X into variable POINTER
- POKE @POINTER+4 ASC("I") ; write "I" to memory at fifth byte position
- TEXT @X ; still displays "SHARY"
- WAITKEY
-
- You have to create a variable which is the address of a string and
- refer to the string itself by double indirection. Here's a correct
- example:
-
- SET XPOINTER "SHARY" ; create pointer variable to point to "SHARY"
- POKE @XPOINTER+4 ASC("I"); write "I" to memory at fifth byte position
- TEXT @@XPOINTER ; display "SHARY"
- WAITKEY
-
- This limitation is imposed by GRASP's own memory management routines
- which are designed to maximize available memory for image buffers.
-
- ---------
- Direct memory reference:
-
- As illustrated in the manual, the indirection function @ looks at the
- contents of what follows. For example, @X refers to the contents of X
- instead of the string "X". However, if @ is used with a number greater
- than 255, GRASP will interpret it as a reference to the contents of
- memory at the given location and will return the string at that address
- up to the first null (ASCII 0) character. For example, @0x287B3E58 refers
- to the string at hex address 287B3E58.
-
- ---------
- You may now set a variable with no value.
-
- ---------
- Environment variables can now be referenced as regular variables, like:
-
- EXEC @COMSPEC ;exec's command.com
-
- ---------
- Two new global variables have been added. The first is @sptr which is the
- current return stack depth. Each time you do a gosub this variable is
- incremented. The other is @mouse, this variable is 1 if there is a mouse
- driver installed, otherwise it is 0.
-
- =============================================================================
- Page 17
-
- =============================================================================
- ---------
- New global variables:
-
- @wrap ;wrap on or off
- @xoff ;global offset on x axis
- @yoff ;global offset on y axis
- @glfs ;filestream number (for DOS) of current open GL
-
- ---------
- New flag is:
-
- SET WRAP ON/OFF controls the wraping of text. If on (the default), single
- CR/LF pairs are ignored unless the next line begins with a space character
- (actually a space or control character). Off will still wrap normally EXCEPT
- CR/LF pairs will be treated as hard returns so tables and preformatted text
- will look ok.
-
- ---------
- A new global variable has been added, @runtime. It is TRUE if we are running
- under GRASPRT.
-
- ---------
- Global variables, @textx and @texty, are the current text pointer, where text
- will continue to print with the next text statement if no coordinates are
- given.
-
- ---------
- Global variables, @viewpage and @drawpage, are the current view and draw
- pages that have been set with setpage or revpage.
-
- ---------
- More new global variables:
-
- @fontxsize ;current font width
- @fontysize ;current font height
- @gap ;current gap between characters
- @sgap ;current width of a space character
- @vgap ;current vertical gap size (between lines)
- @vmode ;current video mode letter
-
- ---------
- New variable @elapsed is the number of 1000ths of a second that have elapsed
- since the last TIMER command.
-
- ---------
- Timer overflow variable (for low level routines that reprogram the PC's timer
- interrupt) has been added. It's at offset 0 in SEG("") (GRASP's variable/text
- segment).
-
- ---------
- New global variable is CLIPTEXT, it can be either SET CLIPTEXT or read
- @CLIPTEXT. If set to ON, then text will not wrap at window boundries, instead
- it will be clipped.
-
- ---------
- Four new global read-only variables, @memfree, @memused, @txtbuf and @txtlen.
- @txtbuf is the address of our current GRASP program in memory (which will
- move around, so be careful). @txtlen is the length of the current text buffer
- (GRASP program). @memfree is the current number of bytes free (available for
- loading pictures, fonts and so on), @memused is the number of bytes GRASP has
- currently used, just like the USED: display in the editor.
- =============================================================================
- Page 18
-
- =============================================================================
-
- Section 3: General Information
- ------------------------------
-
- ---------
- CAP now supports 1024x768x256 modes
-
- ---------
- Any POINT type commands (like LINE or slow TEXT) will now work in bitplane
- modes when done after a TEXT with QUICKTEXT turned on.
-
- ---------
- SET DEBUG ON:
-
- This actually displays a status line at the bottom of the screen.
- When you hit ESC while DEBUG is on you are put at that line in the
- editor (like when you get an error).
-
- ---------
- There is a new command line option for GRASP, GRASPC and GRASPRT. It's -d
- (or /d) which stands for debug and it will force GRASP to run in batch mode
- with all error messages written to stderr (standard error). This option is
- mainly for folks who use editors like Brief to edit their GRASP files and
- want Brief to "know" about errors when you run your text files.
-
- ---------
- New option SET NOCLI ON is added which disables the few remaining lines of
- code that would normally run with interrupts turned off. This option is not
- advised except for those with VERY critical background routines running on
- slower machines!
-
- ---------
- New SET option, SET CLEARKEY ON/OFF defaults to ON. This option controls
- whether GRASP allows type ahead. Normally GRASP will throw away extra key
- presses, this can now be disabled with SET CLEARKEY OFF. This is most useful
- for text input routines.
-
- ---------
- Sigma Legend VGA is now supported.
-
- ---------
- Keyboard routines are speeded up to eliminate long delays from poorly written
- BIOS's (big problem for background sound routines). This will cause problems
- with some old keyboard enhancement programs like Repeat Performance (where
- the repeat will no longer work).
- =============================================================================
- Page 19
-
- =============================================================================
-
- ---------
- Quotes:
-
- A long standing problem with strings and filenames that are not enclosed in
- quotes and yet have a minus character in them just as:
-
- ifkey ctrl-a done
- pload my-pic
-
- is partially resolved, GRASP will now take a minus sign as part of a string
- if the minus is followed by a letter, so ALT-F1 will work, but Alt-1 will
- not. This is because @alt-1 is a valid expression (the variable alt minus
- one), and @alt-f1 would give the value of a variable called "alt-f1". Please
- don't use variable names with minus symbols in them. Use underlines instead
- since the minus characters can make reading an expression very hard. This
- kludge is mainly to help out users of GRASP 3.1 and remove the general
- annoyance of having to use quotes all the time.
-
- ---------
- New SET option MAXCALL will force the CALL statement to use FAR memory
- (same memory as used for pictures, fonts, clippings, DFF's and so on)
- to swap the current text file. This allows you to nest many large text files
- with CALL statments and not run out of memory.
-
- ---------
- All help is rewritten from scratch (sorry to all those folks who were using
- their own help screens). The help is still in GRHELP.OVR, but it is in 4
- script files:
-
- EDIT.TXT --- editor help
- COMMAND.TXT --- command and function help
- FADE.TXT --- fade and mode help
- PAGED.TXT --- code for paged display of help
- USERA.TXT --- user defined help/code ALT-F3 key
- USERB.TXT --- user defined help/code ALT-F4 key
- ...
- USERF.TXT --- user defined help/code ALT-F8 key
-
- The text files are all standard GRASP scripts and can do almost anything
- that a standard script can do (The possibilites are pretty neat!). Since
- this feature has so much more powerful than simple text screens, 5 more user
- defined "help keys" ALT-F3 to ALT-F8 have been put in. The screen is
- automatically restored upon exit from the script. Look at PAGED.TXT for
- example.
-
- ---------
- The ALT-F2 screen has been enhanced to include DFF, FLI, TXT and GRP. It
- also checks the first command on the current line for the default file type.
- The number of lines of filenames displayed is doubled to 8 (as well as
- in the normal load screen off the menu). PGUP and PGDN keys are now
- available in ALT-F2 screen.
-
- ---------
- PCX files are now saved at a origin of 0,0 instead of 1,1. Some programs had
- problems with a non 0,0 origin.
- =============================================================================
- Page 20
-
- =============================================================================
- ---------
- New feature, if you use a number for a command which exceeds 256, the number
- will be treated as an address that will be called. Some example code which
- uses this feature:
-
- set lower readfile(lower.grp)
- set upper readfile(upper.grp)
- @lower "Hello There"
- set str @@0
- text @str ;prints hello there
- @upper @str
- text @@0 ;prints HELLO THERE
- . farfree(@lower)
- . farfree(@upper)
-
- The code for lower.grp in C:
- ----------------------------
- unsigned _acrtused; /* Dummy variable required by linker */
-
- #define code _based(_segname("_CODE"))
-
- unsigned char code buf[256]=""; /* Buffer to build result in */
-
- /* Called function has standard C Parameters passed to it */
-
- unsigned long far main(argc,argv)
- int argc;
- char **argv;
- {
- unsigned char far *dpt;
- register unsigned char *spt;
-
- dpt=buf;
- while(--argc)
- {
- spt=*++argv;
- while(*spt)
- {
- if(*spt>'A' && *spt<='Z') /* Is it Upper case? */
- *spt+=32;
-
- *dpt++=*spt++; /* Copy char into buf */
- }
- }
- *dpt++=0; /* Put the trailing Zero for end of string */
-
- /* Return far pointer to buf */
- return (unsigned long)((unsigned char far *)buf);
- }
-
- The MAKEGRP Batch file to compile .GRP files is as follows:
-
- c:\msc\bin\cl -AS -nologo -Oacgs -Gs -Zl -Zp -FPa -Zi -c %1.c
- link %1;
- exe2com %1.exe %1.grp
- del %1.exe
-
- Also EXE2COM is a public domain program written by Chris Dunford, it is
- available on Compuserve as EXECOM.ARC. This is required if you don't have
- EXE2BIN which IBM/Microsoft no longer ship.
- =============================================================================
- Page 21
-
- =============================================================================
-
- ---------
- LINE2.C, LINE2.GRP and LINE2.TXT are example routines. LINE2.C is a example
- routine which draws a two dot wide line in 320x200 256 color mode. LINE2.TXT
- has a simple example of calling LINE2.GRP.
-
- ---------
- Digitzed Sound:
-
- The syntax of the SOUND.GRP options FIND and USE had to be changed, they no
- longer use the word "soundblaster", but rather "blaster", this is because the
- soundblaster specific data will in the near future be kept in a seperate file
- and the word "soundblaster" has too many letters for a filename. In future
- the:
-
- @sound find blaster
-
- command will look for a file called blaster.dev which will be loaded, the
- .dev file will have the search/detect code, as well as the setup/init code
- and actual DAC port information.
- The 4.0 manual says:
-
- @sound find soundblaster
- @sound port @0
- @sound use soundblaster
-
- but that will have to read:
-
- @sound find blaster
- @sound port @0
- @sound use blaster
-
- The "@sound find" and "@sound port" functions will work with the following
- code:
- load sound
- @sound find blaster
- if @0
- @sound port @0
- @sound use blaster
- endif
-
-
- Also a new feature has been added to sound.grp. It's a speed option, where
- you can adjust the playback speed.
-
- @sound speed 90 ;play back at only 90% of original speed
-
-
- There is a new sound example file called PLAYSND.GL (which is called by
- PLAYSND.BAT). To use try:
-
- PLAYSND GINMILL
-
- ---------
- Automatic oversampling rate in SOUND.GRP. If you specify a oversampling rate
- of 0, a correct oversampling rate will be automatically selected.
- =============================================================================
- Page 22
-
- =============================================================================
-
- ---------
- Editing Keys:
-
- When editing programs in the GRASP editor, the following Wordstar key
- combinations can be used in addition to the keys listed on page 6-8 of
- the manual.
-
- Ctrl-F Next word Ctrl-A Previous word
- Ctrl-R Page up Ctrl-C Page down
- Ctrl-D Next character Ctrl-S Previous character
- Ctrl-X Next line Ctrl-E Previous line
- Ctrl-W Scroll down one line Ctrl-Z Scroll up one line
- Ctrl-Q C Go to end of file Ctrl-Q R Go to beginning of file
- Ctrl-Q D Go to end of line Ctrl-Q S Go to beginning of line
- Ctrl-Q B Go to start of block Ctrl-Q K Go to end of block
- Ctrl-K B Mark start of block Ctrl-K K Mark end of block
- Ctrl-K C Copy block Ctrl-K V Move block
- Ctrl-K R Read in a file Ctrl-K W Write block to disk
- Ctrl-K Y Delete block Ctrl-K H Turn off block
- Ctrl-K D Save changes & exit Ctrl-K Q Abandon changes & exit
- Ctrl-K S Save file & continue Ctrl-K X Exit to main menu
- Ctrl-N Insert new line Ctrl-Y Delete line
- Ctrl-G Delete character Ctrl-Q Y Delete to end of line
- Ctrl-P Insert next character Ctrl-V Toggle insert on and off
- typed, even if it's a
- control character.
-
- ---------
- W option in editor search/replace is in, it will force a search/replace to
- only find a match when the search string is found as a word, so if you
- search for the word "go" it will not match "going" but will match "@go-10".
- Words are defined as not surrounded by letters, so "feb" will match
- "11feb91" but not "february".
-
- ---------
- ^QA and ^QF search/replace and search are available, options are N for
- non-stop (search/replace until there are no more), U for ignore Uppercase
- (match either upper or lower), B for backwards search, and G for global
- (start from beginning of file (or end if backwards is set)). Also a
- repetition count can be specified, this is the number of times to replace or
- find a certain string. Spaces or commas are not required to seperate
- options so 100gu or bg or nu are all valid (case is also ignored, so UG is
- the same as ug). All options except G remain in effect when using ^L
- (repeat search/replace or search).
-
- ---------
- New command line option /T, when turned on will write a list of all opened
- files (and files loaded from a GL) to the file TRACK.LST.
-
- ---------
- New sound utility called NEWRATE added, it lets you convert a sound file to
- a higher OR lower sampling rate.
-
- ---------
- You may add the tutor to a hotkey from the editor or run it as a standalone
- program.
-
- ---------
- Split only works on EGA cards.
-
- --- end of file ---
-