BEE_var()
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    > BEE Variables
    > BEE Syntax
    > BEE Commands
    > Database Operation
    > Content Management
    > Objects and Classes
    v Interface with others
       o BEE and HTML
       o BEE and JavaScript
       v BEE and PHP
          o BEE_get()
          o BEE_var()
          o BEE_isset()
          o BEE_set()
          o BEE_clear()
          o BEE_convert()
          o BEE_do()
    o Glossary
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> Reference >> Interface with others >> BEE and PHP >> BEE_var() <=  =>      <  1  >  
BEE_var($varname) Obtain a reference to a BEE Variable

Return a PHP variable reference to the BEE Variable identified by varname.  If the element part is omitted, the array form of the BEE variable will be returned.

Please note the followings:

n        Remember to use "=&" to receive the reference.  e.g. $a =& BEE_var("apple");

n        Be aware that an array is returned if the element part is omitted.  For example:

<script language="bee">

var myVar = "abc";

</script>

<?php

$arr =& BEE_var("myVar");  // an array in which $arr[""] is "abc"

$elm =& BEE_var("myVar:"); // a scaler "abc"

?>

 

n        Specifying a non-existing element will create that element in the variable array with null.  (This is the same in BEE Script when referring an element with the (var) cast, like "(var)myVar:newElement".)

<script language="bee">

var myVar:x = "abc";  // a single-element array

</script>

<?php

$elm =& BEE_var("myVar:y");

// Now the BEE Variable myVar got a new element y (null value)

// and becomes a two-element array.

$elm = "def";  // myVar now x=>"abc",y=>"def"

?>

 

n        System Class BEE Variables have no corresponding PHP variable reference and therefore cannot be accessed via BEE_var().  You can only use BEE_get () and BEE_set() to access them.  If you retrieve a System Class BEE Variables by BEE_var(), the returned reference has no effect on the BEE Variables at all.  In fact, such PHP Variables is not in the BEE Scope.

n        The "file" part in varname will be ignored if specified.

 

 

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