BEE Variable Value
Username:  
Password:
  > Home
> User Guide
v Reference
    > Introduction
    > CROFT
    v BEE Variables
       > BEE Variable Name
       o BEE Variable Value
       > BEE Conversions
    > BEE Syntax
    > BEE Commands
    > 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 Variables >> BEE Variable Value <=  =>      <  1  2  >  
The data structure of BEE Value

There are only one data structure in BEE Value array of strings.  This is the general form of a BEE Value:

{[#|@][class%][file&]name[:[#]element][=value][|conv[:arg[,...]]]}

 

Note 1: You can add a leading '$' to make a "naked" Value, which can be used outside of the Context (i.e. in other scripts or the HTML scope or attributes).  For example, in the scope of the HTML Text: Click here: <a href="${myLink}">${myCaption}</a>

Note 2: With the optional sizeof operator (the '#' sign right after the open curly bracket), the BEE Value will evaluate to the length of the evaluated string or the number of elements in an array.  (Please see Example 3.)

Note 3: With the optional keyof indicator (the '@' sign right after the open curly bracket), the BEE Value will evaluate to the key of the elements in an array.  This looks trivial as the element name is itself the key.  However, it is useful to get the key from a positional element.  e.g. {@pet:#2} will evaluate to the key of the third element (first one is #0).

Note 4: If the optional value is specified (prefixed by '='), it will be assigned to the variable before the variable is being used (even before sizeof and BEE Conversion).  If the variable name is omitted, a "null variable" will be created to temporarily hold the value.  (A null variable value may sound trivial but can be useful as input to the Conversion without having to create a variable.)  A null variable is treated as an array.  If you want to force it to become a string (for the conversion for example), you can use ":=" instead of "=".

Note 5: The "conv" part is called a BEE Conversion, and it will be applied to the BEE Value before it is returned.  Please see the "var" tag for details.  (Operator sizeof is applied after the BEE Conversion.)

The value of a BEE Variable is specified by a pair of curly brackets surrounding the BEE Variable name.  Whether the variable is in a "scaler" format (with the element part) or an array format (without the element part), it will be converted to string once it was surrounded by a pair of curly brackets.  The resulting string will replace the curly bracket and the variable name in it.  This operation is done repetitively until all BEE Variables in the string are resolved.

Please note that the variable evaluation is done literally.  If variable "a" is "5", "{a}0" will evaluate to "50", and "{a} + 8" to "5 + 8" (not 13).  To make calculation, you need to use "(expr){a} + 8".

 

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