BLHTML.org

BLHTML.org / Web Programming / BLHTML / BLHTML Manual / BLHTML Introduction /

 
  BLHTML syntax 1947 3
How BLHTML designed and provides
  Array handling 1372 0
BLHTML is only capable of one dimensions arrays!
Array can then be sent by the html form.

#$a[key]=value# // Declare $a[key] to value

#$a[*](10=red 20(light grey) color blue)# // Declare key=value, key=value...

$a[10]=#$a[10]#<br>
$a[20](#$a[20]#)<br>
$a[color]=#$a[color]#<br><br>


#$a[+](10=red 20(light grey) color blue)# // Declare key: 0, 1, 2...

#$a[key]#

$a[0]=#$a[0]#<br>
$a[1]=#$a[1]#<br>
$a[2]=#$a[2]#<br>
$a[3](#$a[3]#)<br>
$a[4]=#$a[4]#<br>
$a[5]=#$a[5]#

Returns:
$a[10]=red
$a[20](light grey)
$a[color]=blue

$a[0]=10
$a[1]=red
$a[2]=20
$a[3](light grey)
$a[4]=color
$a[5]=blue

Dynamic arrays:
#$id=8#
#$arr=0#

#SUM value(81$id) null=true return(ant_$id[$arr])#
// Function return array
#$ant_$id[$arr](81$id)# // Declare variable

$ant_#$id#[$arr]=#$ant_$id[$arr]#

Returns:
$ant_8=818

Example of dynamic arrays handling:
#$ok=8#
#$a[$ok]$ok#

1. $a[8] = #$a[$a[$ok]]#<br>
2. $a[8] = #DATA[a[$a[$a[$a[$a[$a[$a[$a[$a[$a[$a[$a[$a[$a[$ok]]]]]]]]]]]]]]]#<br>

#$a[$a[$a[$a[$a[$a[$a[$a[$a[$ok]]]]]]]]](New values)#
3. $a[8] = "#$a[$ok]#"<br>

#$b=7#
#$c=9#
#$a[$b$c]=38#

#$str[$a[$b$c]](is $ok an nice string?)#
$str[38] = "#$str[$a[$b$c]]#"

Returns:
1. $a[8] = 8
2. $a[8] = 8
3. $a[8] = "New values"
$str[38] = "is 8 an nice string?"

More information:
  • Variable handling
  • array
  • #ARRAY#
  • Dynamic variables
  •   Assignment hierarchy with DATA 1618 0
    Example, Assigning strings that contain one or more words:
    #DATA[str_1] post=set value=Hello#
    #DATA[str_2] post=set value='Hello world'#
    #DATA[str_3] post=set value="Hello 'world'"#
    #DATA[str_4] post=set value=('Hello' "world")#
    #DATA[str_5] post=set value('Hello' "world")#
    #DATA[str_6] post=set value{'Hello' "BLHTML" (world)}#


    str_1: #DATA[str_1]#<br>
    str_2: #DATA[str_2]#<br>
    str_3: #DATA[str_3]#<br>
    str_4: #DATA[str_4]#<br>
    str_5: #DATA[str_5]#<br>
    str_6: #DATA[str_6]#

    Returns:
    str_1: Hello
    str_2: Hello world
    str_3: Hello 'world'
    str_4: 'Hello' "world"
    str_5: 'Hello' "world"
    str_6: 'Hello' "BLHTML" (world)

    BLHTML has the same syntax as html.
    If the string don't have any SPACE you don't need:
    • 'quotes'
    • "apostrophes"
    • with or without equal signs
    • (parentheses)
    • {brackets}
    BLHTML recommend attribute() instead of attributes=""

    More information:
  • BLHTML syntax
  • #DATA#
  • array
  • dropdown
  •   The freedom to write BLHTML syntax 1040 0
    2 Example to declare a string:
    #DATA[str] post=set value="Declare a string"#

    The same example that shows us the freedom you have in BLHTML:
    #

    dAtA
                [str]

    vAluE           =
    "Declare
    a       string"


        pOSt

        =          set


    #

    NOTE the variable name is case sensitive (Sensitive to BIG and small letters)
    Exept for that you can write how you like. The function attrib-values can also be written in any order.

    Rules is to be followed?
    BLHTML says: A general readability of code generate less errors
    BLHTML forum  


    apache MySQL PHP No to software patents! BLHTML
    © 2003, 2010 BLHTML
    This page is created with BLHTML in 0.1113 seconds