Wsh Tutorial: Block

  • syntax: nmBlock
  • beispiel: {RZ4+dsn.beispiel.wsh(wshTut33)}

A block groups several constructs in a single unit. Blocks have to flavours: [...$] or /name/...$/name/. The later is called named block and wsh pairs the starting and ending name (improved source readability). Furthermore, wsh can use the block name, e.g. an assignment or proc definition may be abbreviated.

A block is interpreted as a sequence of statements that may be run (object of class ORun), but is often casted by implicit or explicit operators. e.g. the primary $-[time()$] produces the result of the rexx time() function as a string.

a block can only be preceeded by operators, if it is preceeded by a kind, because wsh assumes default kind and operators, sometimes several copies of the same operator character are needed

$#@
$$ --- block ---
$@=¢block1 mit ¢! kind =, expressionLine
    $$ output statement in block1 $!
$@¢call out 'block2 mit ¢! kind @, expressionLine mit call out'
    $$ output statement in block2 $!
$@-/block3/'block3 benannt /name/ ... /name/ kind -, expressionLine'
    $$ output statement in block3 $/block3/
$@#/block4/block4 benannt /name/ ... /name/ kind #, expressionLine
    $$ output statement in block4 $/block4/
$/block4/
$@^/block5/$$ block5 kind ^, output statement
    f1 argument fuer f1 $/block5/
$@%/block6/$$ block6 kind %, output statement
    f1 argument fuer f1 $/block6/
$@:/block7/ vv=block7
    do i=71 to 72 $$ block7 vv=$vv i=$i $/block7/
$proc $@/f1/ $arg aa
     $$ f1 start aa=$aa
     return 'return f1('$aa')'
$/f1/
$#out                                              20161127 10:21:42
--- block ---
block1 mit ¢! kind =, expressionLine
output statement in block1
block2 mit ¢! kind @, expressionLine mit call out
output statement in block2
block3 benannt /name/ ... /name/ kind -, expressionLine
output statement in block3
block4 benannt /name/ ... /name/ kind #, expressionLine
    $$ output statement in block4 $/block4/
block5 kind ^, output statement
f1 start aa=argument fuer f1
return f1(argument fuer f1)
block6 kind %, output statement
f1 start aa=argument fuer f1
block7 vv=block7 i=71
block7 vv=block7 i=72

character set problems

wikiz/osname
¢![]square brackets
|!exclamation mark