Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CALL ABSOLUTE

Status
Not open for further replies.

Oak

Programmer
Aug 6, 2000
77
CA
I got a SUB PROGRAM NOT DEFINE error while attempting to execute a CALL ABSOLUTE statement in QB45, while it always works well in QB.
Code:
REM MOUSE

DECLARE SUB MouseInit ()
DECLARE SUB MouseReset ()
DECLARE SUB MouseHide ()
DECLARE SUB MouseShow ()
DECLARE FUNCTION MouseX% ()
DECLARE FUNCTION MouseY% ()
DECLARE FUNCTION MouseButtons% ()

DIM SHARED a%(34)
DEF SEG = VARSEG(a%(0))
FOR i% = 0 TO 63
  READ d%
  POKE VARPTR(a%(0)) + i%, d%
NEXT i%
DEF SEG

MouseInit
MouseShow

DO
LOOP UNTIL INKEY$ = CHR$(27)

MouseReset
END

'Assembly
DATA 00,00,00,00,00,00,&HB8,00,00
DATA &HCD,&H33,&H3D,&HFF,&HFF,&H75,&H0D,&H0E,&H07 
DATA &HBA,&H24,&H00,&HB9,&HFF,&HFF,&HB8,&H0C,&H00
DATA &HCD,&H33,&HCB,&HB8,00,00
DATA &HCD,&H33,&HCB,&H2E,&H89,&H0E,00,00
DATA &H2E,&H89,&H16,02,00,&H2E,&H89,&H1E,04,00
DATA &HCB,&HB8,01,00,&HCD,&H33
DATA &HCB,&HB8,02,00,&HCD,&H33,&HCB

FUNCTION MouseButtons%
  MouseButtons% = a%(2)
END FUNCTION

SUB MouseHide
  DEF SEG = VARSEG(a%(0))
  CALL ABSOLUTE(VARPTR(a%(0)) + &H3A)
  DEF SEG
END SUB

SUB MouseInit
  DEF SEG = VARSEG(a%(0))
  CALL ABSOLUTE(VARPTR(a%(0)) + 6)
  DEF SEG
END SUB

SUB MouseReset
  DEF SEG = VARSEG(a%(0))
  CALL ABSOLUTE(VARPTR(a%(1)) + &H1E)
  DEF SEG
END SUB

SUB MouseShow
  DEF SEG = VARSEG(a%(0))
  CALL ABSOLUTE(VARPTR(a%(0)) + &H34)
  DEF SEG
END SUB

FUNCTION MouseX%
  MouseX% = a%(0)
END FUNCTION

FUNCTION MouseY%
  MouseY% = a%(1)
END FUNCTION

I can't find anything in about this.
Thanks.
 
You probably need to load the quickbasic standard library using the "/L" param.

At the dos prompt (in your QB45 directory), you would type in:

QB.exe <filename> /L

For other parameters type in: QB /? --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
It works. Thanks.
But it rises an another problem: can you load more than one lib at a time?
 
You cannot load more than one .QLB at a time, but you can compile against multiple .LIB files, and the LINK.EXE utility can take any set of .OBJ and .LIB files and produce a .QLB of them. You can just pass it the /Q parameter and it'll prompt you for all the info it needs, or you can give it all the info on the command-line. Here is the syntax:
[tt]
LINK /Q file1.obj+file2.obj+...,file.qlb,NUL,library1.lib+library2.lib+...
[/tt]
 
Doesn't that is of any use if you can't get the libS to work all togheters(togethers.. Bof anyways..) at once at runtime?
 
Dow, my error! Forget about the last one.[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top