This is the source code for a GIF loader by a Rich Geldreich..
ON KEY x GOSUB
statement, like this:
KEY 15, CHR$(&H04) + CHR$(70) 'CTRL-BREAK KEY 16, CHR$(&H04) + CHR$(&H08) + CHR$(83) 'CTRL-ALT-DEL ON KEY (15) GOSUB 100 ON KEY (16) GOSUB 200 DO ... LOOP 100 PRINT "CTRL-BREAK pressed." RETURN 200 PRINT "CTRL-ALT-DEL pressed." RETURNThis, however, may not work on all systems.
Another way of disabling CTRL-BREAK is as follows:
' DISABLE CTRL-BREAK: dim brk$(3) ' First save the current vectors: def seg=0: for i=108 to 111: brk$(i-108)=str$(peek(i)): next ' Then poke new interrupt vectors: poke 108,83: poke 109,255: poke 110,0: poke 111,240: def seg ' RESTORE CTRL-BREAK: def seg=0: for i=108 to 111: poke i,val(brk$(i-108)): next: def segDo make sure you reenable CTRL-BREAK before exiting your program, or it will stay disabled.
DECLARE
an undocumented routine in the default LIB/QLB like so
DECLARE SUB Name ALIAS "_EXIT" (N AS INTEGER)and use
CALL Name
in place of END
or
SYSTEM
. Name
can be whatever you choose
to name it except a QB reserved word, I used 'Bye'. The value passed must
be between 0 and 255, including 0 and 255.
N
may also be replaced by what ever you see fit to name the variable.
This tip was contributed by Dan Hudson.
TIMER
system variable] timing in BASIC. This
piece of code was written by Zabudsky
Aaron Scott.
OUT &h64, &hfeThis tip came from Karl D. Peralta.
INPUT$
or
LINE INPUT$
are not adequate. The length of the text cannot
be limited, so your screen layout may become cluttered. Also, the program
only continues when the Enter
-key is pressed, and in many
situations, it can be useful to be able to react to other keypresses as
well.
The Edit
-function enables you to control the length of the
input field, provide a default text and react to arrow keys,
PgUp
, PgDn
, function keys, Esc
and
Enter
. For the user, it gives full text editing
possibilities, including Insert/Typeover switching with
Insert
and character erasing with Backspace
and
Delete
.
The Edit
-function is included in a demonstration program,
SHOPLIST.BAS
, which clearly
illustrates the use of the function. The arguments of the function are
three integers: the screen row and column of the first character of the
input field, and the length of the input field. The fourth argument should
be a string variable of sufficient length to hold the text. Note that the
function changes the contents of this variable to the text put in. The
return value is the ASCII-value or the scan code of the key that was used
to end the input. Use the constants that are defined at the start of the
program to compare the return value with, as shown in
SHOPLIST.BAS
. FgCol
and BgCol
are
constants defining the foreground and background colours.
PEEK
and POKE
like this:
DEF SEG = &HB800 POKE 0,65 'Put an A in the top left corner POKE 1,1 'Colour it blue X = PEEK(157) 'Get ASCII value for character in top right cornerThanks to Egbert Zijlema.
,A
after the file name. If you don't have GW-BASIC, you can use RB version
1.58 to convert the files to ASCIIGo back to the BASIC homepage.