Absolute arguments
Username:  
Password:
  > Home
v User Guide
    > Introduction
    > Hello World
    > Flow Control
    v Function Calls
       o Arguments
       o Argument list
       o Absolute arguments
       o Results
       o Context linking
       o Pass by reference
    > Authentication
    > Database access
    > Content Management
    > Remote Calling
    > Object-Oriented
    > Other Features
> Reference
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> User Guide >> Function Calls >> Absolute arguments <=  =>      <  1  >  
Absolute arguments

Argument name preceded by an exclamation mark ('!') either from the declaration line or the calling line will NOT be evaluated before passing.  In the following example, the last line shows the string "{something}" being passed into the function "showme" as is.  The argument is evaluated only inside the function and therefore pick up the local variable, instead of the global as in the first "showme" call.

function showme {
   var something = "in here";
   display "Show me {arg%what}<br>\n";
}

 

var something = "out there";
showme what="{something}";  // Show me out there
showme !what="{something}";  // Show me in here

You can force an argument to be absolute from the declaration line:

function showme !what="{something}" {
   var something = "in here";
   display "Show me {arg%what}<br>\n";
}

 

var something = "out there";
showme;  // Show me in here

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd