Interfaces/VBScript/ex3

From J Wiki
Jump to navigation Jump to search
WScript.Echo "== Example 3 =="

ReDim A1(2,2)
A1(0,0)=1.1 : A1(0,1)=1.2 : A1(0,2)=1.3
A1(1,0)=2.1 : A1(1,1)=2.2 : A1(1,2)=2.3
A1(2,0)=3.1 : A1(2,1)=3.2 : A1(2,2)=3.3

r = j.Set("A1", A1)
WScript.Echo("   A1"  & vbCrLf & DoR("A1"))
j.Do "A2=: >A1"

j.Do "B2=: +/\A2"
j.Do "B1=: <""0 B2"
r = j.Get("B1", B1)

WScript.Echo "   Result:"
For i = LBound(B1,1) To UBound(B1,1)
  s = ""
  For k = LBound(B1,2) To UBound(B1,2)
    s = s & B1(i,k) & " "
  Next
  WScript.Echo s
Next