I added a new class in my project to put general utility routines from APL+Win. Below is the text from the class definition. The function VTM runs fine in Cielo Explorer. All the {}s are balanced. I cannot make the build error "unexpected token <endblock>" go away. The error line number is the last line of the code, where the closing } is located. I wonder if some combination of characters in the converted APL+Win code makes VisualApl think there is an open block?
___________________________________________________________
#region
Using directives
using
System;
using
System.Collections.Generic;
using
System.Text;
using
System.Runtime.InteropServices;
#endregion
namespace
APLN_KregCL_1
{
[
Guid("903C726E-EF0F-45c4-A99E-845742DAD96F")]
[
ClassInterface(ClassInterfaceType.AutoDual)]
[
ProgId("Kreg.GENUtils")]
class KregGEN_UTILS
{
∇
Z←D VTM A
{
⍝ locals: B;BX;CV;CX;R;S;SB;⎕IO
⍝ ∼∼∼ This is a WinCore.W3 function. Make changes in ∼∼∼
⍝
⍝ Copyright (C) 1983 KREG Corporation
⍝ Vector To Matrix conversion; broken out and using conditional looping
⍝ to avoid WS FULLs
⎕IO←1
:IF ⎕monadic ⋄ D←' ' ⋄ :ENDIF
S←⍴A←,A ⋄ B←A∊D
⍝ Append a trailing D delimiter if not already there
:IF ∼0∊S
:IF ∼B[S] ⋄ S←⍴A←A,D ⋄ B←B,1 ⋄ :ENDIF
:ENDIF
Z←(∼B)/A ⋄ A←⎕EX 'A'
SB←0 ⋄ R←⍬
⍝ Get indices of delimiters D. Process in 1 step if vector size <32000
⍝ otherwise loop to get indices.
:IF S<100000 ⋄ B←B/⍳S ⋄ →EN1 ⋄ :ENDIF
LP1:
CV←⍳CX←10000⌊S-SB ⋄ BX←B[SB+CV] ⋄ R←R,SB+BX/CV
:IF S>SB←SB+CX ⋄ →LP1 ⋄ :ENDIF
B←R ⋄ R←⎕EX 'BX CV CX SB'
⍝ Form expansion vector to add trailing blanks, S←shape for result
EN1:
B←¯1+B-0,¯1↓B
S←(⍴B),⌈/B,0 ⋄ A←,B∘.≥⍳S[2]
Z←A\Z ⋄ A←⎕EX 'A' ⋄ Z←S⍴Z
} // VTM
} //KregGEN_UTILS
}
//namespace APLN_KregCL_1