How to use call absolute? 
Author Message
 How to use call absolute?

    Hello.  I'm trying to convert a quickbasic program to the
Firstbasic compiler, and it involves a call absolute statement with
arguments.  The qb code, which works, looks like this:
CALL Absolute(BYVAL fromseg%, BYVAL fromoffset%, BYVAL toseg%, BYVAL
tooffset%, BYVAL bytes%, i%)
    According to what the firstbasic help (and the trypb32 help) claims,
in pb/fb it should look like
CALL Absolute addressvar(parameterlist)
but when I put i% for addressvar and the other parameters seperated by
commmas for parameterlist, it just gives
Error 432: integer scalar variable expected
    I tried other syntaxes but just got syntax errors.  In another part
of the program I also used call absolute addressvar without any other
agruments and that worked.
    Thanks for any help.

--

Physicist / Many Worlder / Devil's Advocate
"I know what no one else knows" - 'Runaway Train', Soul Asylum
My URL: http://www.*-*-*.com/ ~mathmind/

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Thu, 16 Jan 2003 03:00:00 GMT  
 How to use call absolute?
It's ben a while since I used CALL ABSOLUTE. However, in the QB call line:

Quote:
> CALL Absolute(BYVAL fromseg%, BYVAL fromoffset%, BYVAL toseg%, BYVAL
> tooffset%, BYVAL bytes%, i%)

Is the final i% really called by (near) reference? If so, your problem is
that you need to set up your value I% so that you can pass a near reference
to it - that is, it must be located in the current data segment (make i% a
SHARED variable and it will be stored in the default DS) and pass the VARPTR
of it BYVAL.

By default PB passes the full (segment:offset) address of all variables.

It would hlep if you show us the CALL syntax you are trying to use.

One other thing: make sure DEF SEG is set correctly before the call. MS
BASICs will reset DS often, but PB always waits for you to do it yourself.

Oh, yeah, one OTHER thing. If the fromaddress and toaddress represent string
data or string handles, no way will this work 'as is,' as MS and PB use
totally different string engines and the called procedure will need to be
re-done for use with PB. (Or you need to trick PB.  I got an MS-BASIC string
routine to work with PB - once. It was not fun).

--
Michael Mattias
Tal Systems
Racine WI USA

Quote:

>     Hello.  I'm trying to convert a quickbasic program to the
> Firstbasic compiler, and it involves a call absolute statement with
> arguments.  The qb code, which works, looks like this:
> CALL Absolute(BYVAL fromseg%, BYVAL fromoffset%, BYVAL toseg%, BYVAL
> tooffset%, BYVAL bytes%, i%)
>     According to what the firstbasic help (and the trypb32 help) claims,
> in pb/fb it should look like
> CALL Absolute addressvar(parameterlist)
> but when I put i% for addressvar and the other parameters seperated by
> commmas for parameterlist, it just gives
> Error 432: integer scalar variable expected
>     I tried other syntaxes but just got syntax errors.  In another part
> of the program I also used call absolute addressvar without any other
> agruments and that worked.
>     Thanks for any help.

> --

> Physicist / Many Worlder / Devil's Advocate
> "I know what no one else knows" - 'Runaway Train', Soul Asylum
> My URL: http://hammer.prohosting.com/~mathmind/

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Thu, 16 Jan 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Re recursive calls an absolute No No !

2. Far Call to Absolute Address???

3. call is relative or absolute

4. What is the op-code to call an absolute address

5. VAST 4.5 - ODBC Calls Hang Using Abt Coroutine Calls

6. Calling DLL using []NA problem

7. Using SpeakText carbon API Call

8. using modem for answering calls

9. Making Toolbox calls using DECLARE?

10. How to call "system" using VW

11. Calling a procedure using a variable

12. Has anyone used CreateProcess API call?

 

 
Powered by phpBB® Forum Software