Page 1 of 1

Anomalous?

PostPosted: April 24th, 2016, 3:09 am
by Ajay Askoolum
Simple APL+Win variables do not survive the round trip:

Code: Select all
    ∇ Anomalous
[1]   ⍝ Ajay Askoolum
[2]   ⎕cself←'c' ⎕cse 'Init' 'System' 'System.Data'
[3]   ←⎕cse 'ExecStmt' 'using System;'
[4]
[5]   ←⎕cse 'ExecStmt' 'Object x;'
[6]
[7]   ⍝ Are these behaviours expected?
[8]   'Example 1: A literal array of rank 2 does not make the round trip - simple array returns as nested and transposed'
[9]
[10]  ←⎕cse 'SetValue' 'x' (⎕nl 2 3)
[11]  (⎕nl 2 3)≡⎕←⎕cse 'GetValue' 'x'
[12]
[13]  'Example 2: A literal scalar does not make the round trip - scalar returns as vector'
[14]  ←⎕cse 'SetValue' 'x' 'A'
[15]  'A'≡⎕cse 'GetValue' 'x'
    ∇
Is is behaviour expected or is it a bug?

Re: Anomalous?

PostPosted: April 27th, 2016, 10:16 pm
by joe_blaze
Hi Ajay:

We are researching your report and will report back asap.

Joe Blaze

Re: Anomalous?

PostPosted: May 30th, 2016, 2:09 pm
by joe_blaze
Hi Ajay,

Thanks for the report of these issues.

The preservation of the shape of character scalars in the round trip via the CSE 'SetValue' and 'GetValue' can be resolved and will be included in the next version of the CSE.

The non-preservation of the shape of character arrays of rank 2 or greater is a limitation of the Win32 ActiveX interface and is not inherent in the []cse.
This limitation applies to the []wi ActiveX client interface to COM servers as well as the []cse ActiveX client interface to the SignalR server.
Resolving this for []wi and APL+Win as the COM server can be done using the 'apldata' property, because both sides of the interface are APL+Win.
There is no resolution for []wi when the COM server is not APL+Win.
Resolving this for []cse is non-trivial. There is no possibility of changing C#, so using the Win32 ActiveX interface directly as is done now is not a possibility.
It is an interesting issue of which we are aware and will consider some options in a future version of the CSE.

See below for a []wi example which illustrates how the 'apldata' property can be used with []wi and APL+Win on both sides of an ActiveX interface:

⎕wself←'apl'⎕wi 'Create' 'APLW.WSEngine'
⎕wi 'xVisible' 1

⎕wi 'xVariable' 'mat1' (mat1←2 3⍴'abcdef')
mat1Returned←⎕wi 'xVariable' 'mat1'
⍴⎕←mat1⋄⍴⎕←mat1Returned
abc
def
2 3
abc def
2

⎕wi 'xVariable' 'mat2' (mat2←2 3 4⍴'abc')
mat2Returned←⎕wi 'xVariable' 'mat2'
⍴⎕←mat2⋄⍴⎕←mat2Returned
abca
bcab
cabc

abca
bcab
cabc
2 3 4
abca bcab cabc
abca bcab cabc
2 3
⎕wi 'apldata' 1
⎕wi 'xVariable' 'mat1' (mat1←2 3⍴'abcdef')
mat1Returned←⎕wi 'xVariable' 'mat1'
⍴⎕←mat1⋄⍴⎕←mat1Returned
abc
def
2 3
abc
def
2 3
⎕wi 'xVariable' 'mat2' (mat2←2 3 4⍴'abc')
mat2Returned←⎕wi 'xVariable' 'mat2'
⍴⎕←mat2⋄⍴⎕←mat2Returned
abca
bcab
cabc

abca
bcab
cabc
2 3 4
abca
bcab
cabc

abca
bcab
cabc
2 3 4