Wsh Tutorial: Object

  • syntax: stmt
  • beispiel: {RZ4+dsn.beispiel.wsh(wshTut38)}

object and classes support the following features

  • object fields
  • methods with dynamic dispatching
  • multiple class inheritance
  • meta data for classes

statements with, forWith and withNew ease the use of objects

$#@
$$ --- object ---
$= strich = ----------
$<>
$withNew $@:¢fA=aha $=fB=feld B $!
$withNew $@:¢fA=aZwei $=fB=feld B 2 $!
$|
$forWith i $@¢
    $$- o2Text($i) $strich
    $$ via $'$i' fA=${i&fA} fB=${i&fB}
    o = $i
    fldA = 'fA'
    fldB = 'fB'
    $$- 'rexx' fldA'='m.o.fldA fldB'='m.o.fldB
    $$ with fA=$fA fB=$fB
    $!
$$ column table to objectBuffer $strich
$<>
$= b =. jBuf()
$@=¢
eins     zwei    drei
1        a 1     eins
2        b  2    zwei
3                drei 3
$!
$| $@. csvColRdr()
$>.b
$<>
$$ pipeWriteAll buffer $strich
call pipeWriteAll $b
$<>
$$ tabulate buffer $strich
call fTabAuto $<.b
$#out                                              20161127 13:37:48
--- object ---
O.177.1=¢fA=aha fB=feld B! ----------
via $i fA=aha fB=feld B
rexx fA=aha fB=feld B
with fA=aha fB=feld B
O.177.2=¢fA=aZwei fB=feld B 2! ----------
via $i fA=aZwei fB=feld B 2
rexx fA=aZwei fB=feld B 2
with fA=aZwei fB=feld B 2
column table to objectBuffer ----------
pipeWriteAll buffer ----------
O.188.1=¢eins=1 zwei=a 1 drei=eins!
O.188.2=¢eins=2 zwei=b  2 drei=zwei!
O.188.3=¢eins=3 zwei= drei=drei 3!
tabulate buffer ----------
e zwei drei
1 a 1  eins
2 b  2 zwei
3      drei 3
$#out                                              20161127 13:37:23

$

character set problems

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