Codeblock, literal date, literal array symbol
Braces ({ }) enclose codeblocks, literal dates, and literal array elements. They must always be paired. The following examples show how braces may be used in dBL code.
Literal dates are interpreted according to the current settings of SET DATE and SET EPOCH:
dMoon = {07/20/69} // July 20, 1969 if SET DATE is MDY and SET EPOCH is 1950
To enclose arrays
a = {1,2,3}
? a[2] // displays 2
To assign a statement codeblock to an object’s event handling property
form.onOpen = {;msgbox("Warning: You are about to enter a restricted area.")}
To assign an expression codeblock to a variable, and pass parameters to it
c = {|x| x*9}
? c(4) // returns 36
// or
q = {|n| {"1st","2nd","3rd"}[n]}
? q(2) // displays "2nd"
To assign an expression codeblock to a variable, without passing parameters
c = {|| 4*9} // pipes (||) must be included in an expression codeblock,
// even if a parameter is not being passed
? c( ) // returns 36