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  >  
Examples The data structure of BEE Value

Example 1:

var myinfo = "age";

var age = 18;

display "What is your {myinfo}? ";  // What is your age?

display "I'm {{myinfo}}. ";  // I'm 18.

 

Example 2:

// "customer" is a database select result currently

// pointing to a man called Peter Smith.

var person = "(database)customer";

var sexName = "(array)M=>Male,F=>Female";

var title = "(array)Male=>Mr,Female=>Ms";

display "Hello, {title:{sexName:{person:Sex}}} {person:Name}";

// Output: Hello, Mr Peter Smith

 

Example 3:

var abc = "IAmFine";

// {abc} -> IAmFine

// {abc|words} -> {abc:|words} I Am Fine

// {#abc} -> 1 (as the array has only one element)

// {#abc:} -> 7 (and that element evaluates to 7-char string)

// {#abc:|words} -> 9 (and it is "I Am Fine", 9-char long)

 

Please note that ${#myname} returns the number of elements in the myname array, and ${#myname:} returns the length of its default element (the one indexed by blank in the myname array).  That's why from the above example, {#abc} evaluates to 1 and {#abc:} evaluates to 7.

 

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