P:()(), PasCall() Function

Purpose

executes a subroutine at a specified address and returns a Long value.

Syntax

x = P:(addr)([parameters])

x = PasCall(addr)([parameters])

x:iexp
addr:iexp
parameters:aexp

Description

The parameters are placed in reverse order on the stack. P:()() and PasCall()() expects the subroutine to clear the stack.

a% = P:(addr%)(1, 2, 3)

12[esp] 1

8[esp] 2

4[esp] 3

[esp] Return address

the called routine must end with ret 12, correcting the stack pointer.

The parameters can be coerced to a specific format using by preceding the value with one of the following designators:

Dbl: double
Sng: float, single
Large: Large integer
Cur: Currency value
L: Long
Int: Integer
Var: Variant

Example

Dim a% = ProcAddr(test)

~P:(a%)( Large:2, 3 )

' or

~PasCall(a%)( Large:2, 3)

 

Procedure test(i%, la As Large)

Print la, i%

EndProc

Remarks

A Procedure takes it parameters by value using the StdCall convention.

See Also

C:(), LC:(), LP:(), Call(), CallX(), CCall(), LCCall(), LPasCall(), StdCall(), LStdCall()

{Created by Sjouke Hamstra; Last updated: 21/10/2014 by James Gaite}