TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: TIM HUTZLER
from: ANTON MONROE
date: 1996-06-17 05:37:00
subject: QuickBasic & PowerB 02/05

Continued from the previous message...

    habit of just using one variable:
       DIM Regs as RegType
       CALL INTERRUPT (&h10, Regs, Regs)
    which makes translation to PowerBasic easier simply because it makes
    the above technique impossible.
    QB allows either:
       CALL INTERRUPT (&h10, InRegs, OutRegs)  (CALL and parentheses)
    or
       INTERRUPT &h10, InRegs, OutRegs         (no CALL, no parentheses)
    which is consistent with other uses of CALL.  PB requires the CALL,
    but without the parentheses around the argument.
    In an example like this:
        reg %dx,varptr(x)
    PB also must be told what segment to use by putting varseg(x) into
    %ds.  In QB, if Regs.DS is 0, it assumes the data segment and fills
    it in automatically.
 CALL ABSOLUTE--
    QB uses "CALL ABSOLUTE ([parameter list,] integer address)"
    PB uses "CALL ABSOLUTE integer address[(parameter list)]"
    I cannot seem to get PB to accept "varptr(x)" as an address, so
       CALL ABSOLUTE VARPTR(X)
    has to be changed to:
       Offset% = VARPTR(x) : CALL ABSOLUTE Offset%
 COMMAND$--
    QB converts the command tail to upper case before returning it.  PB
    returns it exactly as entered.  So when you check for command line
    switches in PB you need to remember to check for both upper and
    lower case versions.
 CONST--
    QuickBasic Constants are the equivalent of PowerBasic Equates.  QB
    allows constants of any type (%,&,!,#, or $), and if no type
    character is supplied, it will automatically make it the simplest
    type that will hold the value.  PowerBasic only allows integer
    Equates.  QB declares them with the keyword CONST; PB with the %
    prefix.  In QB, several constants can be declared on one line with
    one CONST statement; PB requires a separate statement for each one.
    QB constants are not really constant.  A constant declared outside a
    SUB or FUNCTION has scope anywhere in the module, but a constant
    defined within a sub or function is local.
       CONST X% = 1, Y% = 2
    would become:
       %X = 1
       %Y = 2
    In converting non-integer constants, I suppose the best thing would
    be to turn them into variables, either local or shared as
    appropriate.
 DECLARE--
    PB apparently does not allow the ANY type, which turns off parameter
    type checking in QB.
    (Later: saw a message from Barry Erick that says that ANY =is=
    allowed in PB, but only for going to an .OBJ module)
 DIM--
    The syntax of DIM and REDIM differ.  A typical QB statement would
    be:
       DIM SHARED Fee%(10), Fie$(10)

Continued in the next message...
--- FidoPCB v1.4 [ff013/c]
---------------
* Origin: Sound Advice - 24 Nodes (816)436-4516 (1:280/333)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.