As mentioned in the previous page, all BEE Commands can be presented in two semantically equivalent syntaxes. This is the same for variable assignments:
<beevar var=a value="hello world"> |
or
<script language="bee"> var a = "hello world"; </script> |
As with HTML tag attributes, quotation marks are required only if the attribute value got spaces in it. Otherwise, it is perfectly OK not to use quotation marks:
or
<script language=bee> a = hello; </script> |
However, this create an ambiguity in variable assignment syntax in BEE Script. What if "hello" is a variable name? In that case, the value needs to be preceded by "(var)".
<bee var=hello value='Good morning'> <bee var=a value=(var)hello> |
or
<script language=bee> hello = 'Good morning'; a = (var)hello; </script> |
After the above, both variables ("hello" and "a") contain "Good morning".
By the way, single and doulbe quotation marks can be used interchangably (but needs to be in pair). For example, "It's great!" and 'It\\'s great!' are equivalent. Also, excessive quotation marks are simply ignored and won't cause any troubles:
<bee var=hello value="Good morning"> <bee var=a value="(var)hello"> |
or
<script language=bee> hello = "Good morning"; a = "(var)hello"; </script> | Back Next
|
Print
<= => < 1 2 3 4 5 6 >
|