BEE Variables
  > 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

sys Class
debug Class
Intrinsic Conversions
>> Reference >> BEE Variables <=  =>      <  1  >  
BEE Variables BEE Variable Name and Value

BEE Variables are simple but powerful.  They are simple because there is only one data structure array.  No pointers and data type constraints, everything is purely string macros.

For example, after var abc = "myvalue";, variable abc contains the literal "myvalue".  Then after we do var xyz = "abc";, we got xyz containing "abc" and {xyz} containing "myvalue".  Now we create an array out of thin air (as it's already there): var abc:april = "fool"; var abc:may = "flower";, then {abc|list} will give "''=>'myvalue','april'=>'fool','may'=>'flower'", and so will {{xyz}|list} because {xyz} evaluates to abc, and {{xyz}|list} evaluates to {abc|list}.  We've just changed the language from "containing" to "evaluating".  Now you got the idea.  (Please note that "list" used in the above example is called a BEE Conversion to convert an array into a displayable string.)

Curly bracketed variables always evaluate to a string.  To specify the variable as a whole with all its array elements, you need to use the (var) cast.

In the following sample code, the comment lines (the ones starting with "//") indicate the possible evaluations, where the arrow "->" means "evaluates to".

var abc = "myvalue";

   // {abc} -> myvalue

   // {abc:} -> myvalue

var xyz = "abc";

   // {xyz} -> abc

   // {{xyz}} -> {abc} -> myvalue

var abc:april = "fool";

   // {abc:april} -> fool

var abc:may = "flower";

   // {abc:may} -> flower

   // {abc|list} -> ''=>'myvalue','april'=>'fool','may'=>'flower'

   // {{xyz}|list} -> {abc|list} -> (ditto)

var yourval = "{abc}";

   // {yourval} -> {yourval:} -> myvalue

   // {yourval|list} -> =>myvalue

var def = (var)abc;

   // {def} -> {def:} -> myvalue

   // {def|list} -> =>myvalue,april=>fool,may=>flower


Please note that the double quotation marks surrounding the values (the right-hand-side of the assignment) are optional, and can be replaced by single quotation marks.  If there is no spaces in the value string, the quotation marks can be omitted altogether.

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