'>>> Page 3 of QBPSEUDO.FAQ begins here.
by the Waite Group
MicroSoft Press ISBN: 1-55615-262-0
* Good examples on EVERY command
Another good book that deals with INTERRUPT programming:
"MD-DOS 5 Programming"
by Peter G. Aitken
MicroSoft Press ISBN: 1-55615-471-2
* Sample code in QuickBasic and C for MANY interrupt calls
*> "How do I get a number from a string into an Integer?" Use:
X% = VAL(TheString$)
*> "How do I remove spaces from a string?"
To remove spaces at the beginning of a string use
X$ = LTRIM$(TheString$)
To remove spaces at the end of a string use
X$ = RTRIM$(TheString$)
To remove at both beginning and end use
X$ = LTRIM$(RTRIM$(TheString$))
*> "What are 'String Descriptors'?"
Generally you will never need to know this unless you plan to write
ASM or C routines to use with QuickBasic. String Descriptors are
packs of 4 bytes that contain the offset within the DGROUP that the
actual text of the string starts at and the length of the data. QB
does not use ASCIIZ strings (strings that end with a CHR$(0)) so you
must convert them in your code if you wish to use them with C in
most cases. The block looks like:
2 bytes Offset within DGROUP
2 bytes Length of string data
Both are UNSIGNED integers (0-65535)
*> "What is the difference between QBASIC and QuickBasic?"
A lot! Some of them are:
QBASIC will not compile a BAS file into a EXE, QB45 does.
QBASIC does not have a CALL INTERRUPT, QB45 does.
QBASIC does not allow use of LIBs, QB45 does.
QBASIC is a stripped down version of QB45 included with DOS 5.0 and
above.
QuickBasic must be purchased. The retail price varies but should be
around $65-$80 U.S..
Generally, almost all BAS code will run in QBASIC. The exception is
that if is uses INTERRUPTS or outside LIBs, it will not. There is
however a CALL ABSOLUTE that does allow SOME access to ASM code but
it is not simple and the routines must be small. Generally, if you
are an occasional programmer, QBASIC will do just fine, however, if
you want to end up with an EXE file or do some serious programming,
QB45, or PDS would really be the way to go. Other packages available
are Power Basic and Visual Basic for DOS. These other two packages
are fine too and provide some additional commands over QB45 but as
such are not backward compatible to QB45.
*> "How do I convert from a HEX number to DECIMAL or DECIMAL to HEX?"
To change from a HEX string to an integer:
TheString$="6B"
X%=VAL("&H"+TheString$)
To change from an integer to a HEX string:
X$=HEX$(TheInteger%)
*> "How do I make QuickBasic reboot the system?"
Here is a simple code snippit to do just this:
SUB WarmBoot
DEF SEG = 0
POKE &h473, &h12
POKE &h472, &h34
DEF SEG = &hFFFF
CALL ABSOLUTE(0)
'>>> Page 3 of QBPSEUDO.FAQ ends here. Continued on next page.
-+- OLMS 2.53 UNREG
---
---------------
* Origin: Most Wanted BBS +44 (0)1522 887627 & 887628 * (2:2503/509)
|