• Is it possible to display APL characters in Excel VBA Textbox?

    From Don Wiss@21:1/5 to All on Sat Sep 19 07:25:26 2020
    I am working on converting my DOS application to Windows. Finally. The
    front end is all Excel forms driven from a toolbar. Then APL+Win running as
    an ActiveX server to do the calculations and produce the output (but back
    to Excel for graph formatting).

    I have nested variables that contain the information for the custom report writers. They include two strings that contain APL code.

    In the DOS APL I have a full screen editor to manage the variables. For
    Windows I could write something in APL+Win, but I have no idea how. So I developed a VBA UserForm to manage them.

    But how to display and read back the APL code? I would also need to be able
    to paste code strings into the Textbox.

    I started with two regular Textboxes and set them to the APL+Win font. They displayed gobbledegook. I ran the code through AV2ANSI first. Some APL characters appeared. But the up arrow went blank and the floor became a U umlaut. (I did not try sending the strings back to APL.)

    I looked into RichText boxes. I installed the Microsoft Rich Textbox
    Control 6.0. But I get the error "The subject is not trusted for the
    specific action." Possibly as I'm still using Excel 2002 (heh, the VBA is
    the same).

    If I upgrade my Excel, is this going to work for what I want to do? There
    is also this: http://www.lebans.com/richtext.htm. But it seems so
    complicated for something that seems simple to me.

    My APL+Win is version 7.2. I will have to eventually sign up for a new
    version, but once I do the two year clock starts ticking.

    What is the solution for what I want to do?

    Don. www.bondcalc.com.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From AA2e72E@lycos.co.uk@21:1/5 to All on Sat Sep 19 05:32:43 2020
    Excel's text boxes have <font> and <multiple> properties; choose an APL font for the<font> property & set <MultiLine> to True.
    You can copy <whatever> from an APL+Win session & paste into the Excel text box.

    1. If you have "Enable Unicode Clipboard' option under the APL+Win Edit menu option in v7.2, enable it.
    2. If you don't, you will have to use AV2ANSI & ANSI2AV.
    3. Check the documentation for []UCS if it is in v7.2.

    To me it seems that your intention is to use an Excel Form's textbox as an APL Editor - that is the hardest of all options available to you!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From AAsk@21:1/5 to All on Sat Sep 19 08:12:26 2020
    - Excel & APL+Win (or any other application) will NOT be able to share (interact with) a form - a form is only accessible by the thread that creates it. (There are workarounds but there are too onerous for production code).
    - Neither an Excel form not an APL form will permit input using an APL keyboard; this rules out the entry of APL primitives in an edit box EXCEPT by pasting.

    PS: try raising the question in https://groups.google.com/g/aplwin also.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From J. Clarke@21:1/5 to All on Sat Sep 19 11:01:03 2020
    On Sat, 19 Sep 2020 07:25:26 -0400, Don Wiss <donwiss@no_spam.com>
    wrote:

    I am working on converting my DOS application to Windows. Finally. The
    front end is all Excel forms driven from a toolbar. Then APL+Win running as >an ActiveX server to do the calculations and produce the output (but back
    to Excel for graph formatting).

    I have nested variables that contain the information for the custom report >writers. They include two strings that contain APL code.

    In the DOS APL I have a full screen editor to manage the variables. For >Windows I could write something in APL+Win, but I have no idea how. So I >developed a VBA UserForm to manage them.

    But how to display and read back the APL code? I would also need to be able >to paste code strings into the Textbox.

    I started with two regular Textboxes and set them to the APL+Win font. They >displayed gobbledegook. I ran the code through AV2ANSI first. Some APL >characters appeared. But the up arrow went blank and the floor became a U >umlaut. (I did not try sending the strings back to APL.)

    I looked into RichText boxes. I installed the Microsoft Rich Textbox
    Control 6.0. But I get the error "The subject is not trusted for the
    specific action." Possibly as I'm still using Excel 2002 (heh, the VBA is
    the same).

    If I upgrade my Excel, is this going to work for what I want to do? There
    is also this: http://www.lebans.com/richtext.htm. But it seems so
    complicated for something that seems simple to me.

    My APL+Win is version 7.2. I will have to eventually sign up for a new >version, but once I do the two year clock starts ticking.

    What is the solution for what I want to do?

    For APL+Win, the obvious solution is to have it pop up its own edit
    window. There's a manual about an inch thick about how to use the
    Windows functionality of APL+Win--you should have either a paper copy
    or a PDF or Word copy in the folder in which APL is installed or one
    of the subfolders. There should also be a workspace with some example
    code.

    The docs are not good but you should be able to figure out enough to
    get started.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don Wiss@21:1/5 to J. Clarke on Sun Sep 20 18:49:51 2020
    On Sat, 19 Sep 2020, J. Clarke <jclarke.873638@gmail.com> wrote:

    For APL+Win, the obvious solution is to have it pop up its own edit
    window. There's a manual about an inch thick about how to use the
    Windows functionality of APL+Win--you should have either a paper copy
    or a PDF or Word copy in the folder in which APL is installed or one
    of the subfolders. There should also be a workspace with some example
    code.

    The docs are not good but you should be able to figure out enough to
    get started.

    Thanks for the suggestion, but that is a lot of effort for something that
    is of minor importance. It's only for me, the developer, and whomever ends
    up maintaining this program the future.

    See my prior post on what I did, and what I have left to complete.

    Don. www.bondcalc.com/windows
    Don. www.donwiss.com (e-mail link at home page bottom).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don Wiss@21:1/5 to AAsk on Sun Sep 20 18:49:57 2020
    On Sat, 19 Sep 2020 08:12:26 -0700 (PDT), AAsk <AA2e72E@lycos.co.uk> wrote:

    - Excel & APL+Win (or any other application) will NOT be able to share (interact with) a form - a form is only accessible by the thread that creates it. (There are workarounds but there are too onerous for production code).

    No interaction needed. Just passing code strings back and forth. Not
    processing it.

    - Neither an Excel form not an APL form will permit input using an APL keyboard; this rules out the entry of APL primitives in an edit box EXCEPT by pasting.

    Pasting is all I want. But using AV2ANSI not all characters appeared. I'll stick with what I described above. And revisit when I upgrade my APL.

    PS: try raising the question in https://groups.google.com/g/aplwin also.

    Thank you! I was not aware of this group. I see there that Brent died. How
    sad. I did not know this. I do know that the e-mail I once had for him no longer worked and I couldn't find a replacement.

    What ever happened to Jim Weigang? Looking up his West Springfield address
    I find the house was sold in 1999 (and many times after that).

    Don. www.bondcalc.oom/windows

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don Wiss@21:1/5 to AA2e72E@lycos.co.uk on Sun Sep 20 18:49:38 2020
    I finished the project I started after posting. Now I'm back to this.

    On Sat, 19 Sep 2020 05:32:43 -0700 (PDT), <AA2e72E@lycos.co.uk> wrote:

    Excel's text boxes have <font> and <multiple> properties; choose an APL font for the<font> property & set <MultiLine> to True.

    I picked one of the APL+Win fonts. Why set to MultiLine?

    1. If you have "Enable Unicode Clipboard' option under the APL+Win Edit menu option in v7.2, enable it.

    I have a PDF of the vesion 7 manual. I do not have it.

    2. If you don't, you will have to use AV2ANSI & ANSI2AV.

    Okay. I used them. Code transfers to VBA and back with no changes! I will
    look into the Unicode after I upgrade.

    To me it seems that your intention is to use an Excel Form's textbox as an APL Editor - that is the hardest of all options available to you!

    But editing the couple lines of code is a minor part of this editor. These specification databases haven't been changed in a couple decades. Then the
    code that creates the columns and some totals isn't going to change. What
    will change is all the dippy column formatting parameters.

    What I did was to disable the VBA Texboxes containing the code. Then in APL
    I wrote a prompt function that let's one view and update the code strings within the nest. Tight edits. Works like a charm.

    But I still have two issues:

    (1) I do not know how to insert back into a nest. I tried:

    (6{disclose}{each}m){<-}ANSI2AV{each}6{disclose}{each}m

    But it did not work. I ended up with a loop:

    (6{disclose}i{disclose}m){<-}ANSI2AV 6{disclose}i{disclose}m

    (2) And this one is so far fatal to the project:

    VBA does not have a direct replacement for APL's numeric vectors. Passing a vector to VBA gets you an array of scalars. Okay. But when I pass this
    array back to APL I get a nest of scalars. What is the APL to turn this
    back into a vector? These "vectors" are within the nest.

    Don. www.bondcalc.com/windows
    Don. www.donwiss.com (e-mail link at home page bottom).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From AAsk@21:1/5 to All on Sun Sep 20 22:25:52 2020
    1. Replace in an APL nested vector

    a←(⍳12) (2 4⍴⍳8) ('M') (,['']⍳5)
    a
    1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 M 1
    5 6 7 8 2
    3
    4
    5
    (3⊃a)←⊂'Mon' 'Tue' ⍝ Change 3rd element of nested vector

    a
    1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 Mon Tue 1
    5 6 7 8 2
    3
    4
    5

    2. Turn nested NUMERIC vector into simple

    a←,¨⍳5
    a
    1 2 3 4 5
    1⊃a ⍝ first element
    1
    ≡a ⍝ 2 if nested
    2
    b←∊a ⍝ turn into simple
    ≡b
    1

    3. Change rank of an element inside a nested variable

    a←(⍳12) (2 4⍴⍳8) ('M') (,¨⍳5)
    ≡¨4⊃a
    1 1 1 1 1
    (4⊃a)←∊4⊃a
    ≡¨4⊃a
    0 0 0 0 0

    Hints:
    a. Try the executable expressions above with V7.2; APL+Win will display more neatly than it appears here.
    b. Consider using keywords for APL symbols e.g. for ≠ you could use &ne or #ne, for ⍳ you could use &iota or #iota
    Then in APL you maintain a table of two columns symbol, keyword - use this for a simple lookup bidirectionally (will save you the hassle of grappling with the APL character set).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From AAsk@21:1/5 to All on Sun Sep 20 22:42:39 2020
    Why set to MultiLine?
    - Unless you do, you will need to separate discreet APL expressions with diamond (i.e. the value of the text box is one long vector) which will give you another APL symbol to grapple with.
    -When you do <ENTER> will jump to the next line so the second and subsequent APL expresion will appear on a different line.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jibanes@gmail.com@21:1/5 to All on Sun Jan 31 09:21:57 2021
    What ever happened to Jim Weigang? Looking up his West Springfield address
    I find the house was sold in 1999 (and many times after that).

    Not sure, I emailed him some time ago, but his account at mit had been removed. Let me know if there's another way to reach out to Jim.

    Jerome

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Don Wiss@21:1/5 to jib...@gmail.com on Sun Jan 31 16:31:03 2021
    On Sun, 31 Jan 2021, "jib...@gmail.com" <jibanes@gmail.com> wrote:

    What ever happened to Jim Weigang? Looking up his West Springfield address >> I find the house was sold in 1999 (and many times after that).

    Not sure, I emailed him some time ago, but his account at mit had been removed.
    Let me know if there's another way to reach out to Jim.

    He is still alive, but has mostly gone off grid. I wrote to the owner of chilton.com. He wrote that he would forward my note to Jim. I never heard
    back from Jim.

    Don. www.donwiss.com (e-mail link at home page bottom).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)