parent
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    > BEE Variables
    > BEE Syntax
    v BEE Commands
       > Variable Operations
       > Conditional
       > Loop
       v Module Calling
          o function
          o return
          o global
          o parent
          o include
          o exec
          o exit
       > Remote Calling
       > Authentication
       > Data Access
       > Socket
       > Special Functions
    > Database Operation
    > Content Management
    > Objects and Classes
    > Interface with others
    o Glossary
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> Reference >> BEE Commands >> Module Calling >> parent <=  =>      <  1  >  
parent – declare a variable to be from the parent Context

BEE Script:   parent var;

 

BEE Tag:     <beeparent "var">

 

The "parent" command is valid only within a function. It declares that a variable is equivalent to the one in the "parent" (the calling function's Context), which means that the variable inherit the value set before the function call, and any changes to them inside the function survive the exit of it.

In another word, "parent" variables are references to the caller's variables.

However, if the function calls another function, the "callee" function would not see the variables declared "parent" in the "caller" function, unless the "callee" declares these variables "parent" as well.

If the variable name var is missing, the whole Context (all variables in the parent Context) will be linked with the one of the parent.  (Please use this carefully to avoid polluting the parent's environment.)

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