AsmFns v2.0.0.0

AsmFns is a C# ActiveX DLL containing a C# version of all the APL+Win well known ASMFNS.W3 Assembler functions.

Because the ASMFNS.W3 APL+Win functions are so much used in APL+Win applications, AsmFns is invaluable when you want or need to rewrite part of all of an APL+Win application in C#.

AsmFns can be used from C#, APL+Win and Dyalog APL.

Requirements

AsmFns requires:

  • the .Net Framework v4.0+

Download

Download a fully functional 30-day Trial:

Download »

Features

Here is the list of the ASMFNS functions which are part of the AsmFns C# DLL, with their respective syntax:

object AV(object strind);
string DEB(string text, string chars);
object DIV(object A, object B);
string DLB(string text, string chars);
string DLTB(string text, string chars);
string DTB(string text, string chars);
string[] DTBR(string[] mat1);
object INDEX1(object array, int[] inds);
string[] LJUSTIFY(string[] mat1);
string LOWERCASE(string str);
string MATtoSS(string[] mat, string delim);
int NBLENGTH(string text);
string[] OVER(string[] mat1, string[] mat2);
string[] RJUSTIFY(string[] mat1);
int[] ROWFIND(string[] mat1, string[] mat2);
int ROWFIND(string[] mat1, string mat2);
string SSASSIGN(string ss1, int[] ind, string ss2);
string SSCAT(string ss1, string ss2);
string SSCOMPRESS(bool[] b, string ss);
string SSDEB(string ss);
string SSDLB(string ss);
string SSDLTB(string ss);
string SSDROP(int nb, string ss);
string SSDTB(string ss);
int[] SSFIND(string ss1, string ss2);
string SSINDEX(string ss1, int[] ind);
int[] SSLEN(string ss);
int SSSHAPE(string ss);
string SSTAKE(string ss, int nb);
string[] SStoMAT(string ss);
bool[] SSUNIQUE(string ss);
string[] TELPRINT(string[] mat, int width);
string TEXTREPL(string str, string text);
string TRANSLATE(string xlat, string text);
string UPPERCASE(string str);
int[] WHERE(bool[] bits);
string WORDREPL(string str, string text);

Examples

Using the ASMFNS functions is very easy. Here are a few examples from various languages:

Example 1: from APL+Win

      'asmfns'⎕wi'Create' 'LC.AsmFns.AsmFns'
asmfns

      ⊃'asmfns'⎕wi'TELPRINT'('asmfns'⎕wi'methods')80
Close        Info         XDEB         XMATtoSS     XSSDEB       XSSTAKE
Create       Modify       XDIV         XNBLENGTH    XSSDLB       XSSUNIQUE
Defer        New          XDLB         XOVER        XSSDLTB      XSStoMAT
Delete       Open         XDLTB        XRJUSTIFY    XSSDROP      XTELPRINT
EnumEnd      Ref          XDTB         XROWFIND     XSSDTB       XTEXTREPL
EnumNext     Send         XDTBR        XROWFIND_2   XSSFIND      XTRANSLATE
EnumStart    Set          XINDEX1      XSSASSIGN    XSSINDEX     XUPPERCASE
Event        SetLinks     XLJUSTIFY    XSSCAT       XSSLEN       XWHERE
Exec         XAV          XLOWERCASE   XSSCOMPRESS  XSSSHAPE     XWORDREPL

      'asmfns'⎕wi'SSFIND' '/this/is/a/segmented/string' '/segmented/this'
3 0
      
      ⊃'asmfns'⎕wi'SStoMAT' '/this/is/a/segmented/string'
this
is
a
segmented
string

      'asmfns'⎕wi'WORDREPL' '/this/these/is/are/a//string/strings' 'this is not a segmented string'
these are not  segmented strings

      ('asmfns'⎕wi'DEB' '     This    is      a  segmented   string with   blanks' ' '),'.'
This is a segmented string with blanks.

Example 2: from Dyalog APL

      ⎕pw←80 ⋄ ⎕ml←3

      'asmfns'⎕wc'OLEClient' 'LC.AsmFns.AsmFns'

      ⊃asmfns.TELPRINT asmfns.MethodList 80
AV          INDEX1      ROWFIND     SSDLTB      SSTAKE      WHERE     
DEB         LJUSTIFY    ROWFIND_2   SSDROP      SStoMAT     WORDREPL  
DIV         LOWERCASE   SSASSIGN    SSDTB       SSUNIQUE              
DLB         MATtoSS     SSCAT       SSFIND      TELPRINT              
DLTB        NBLENGTH    SSCOMPRESS  SSINDEX     TEXTREPL              
DTB         OVER        SSDEB       SSLEN       TRANSLATE             
DTBR        RJUSTIFY    SSDLB       SSSHAPE     UPPERCASE             

      asmfns.SSFIND '/this/is/a/segmented/string' '/segmented/this'
3 0
      ⊃asmfns.SStoMAT ⊂'/this/is/a/segmented/string'
this     
is       
a        
segmented
string   

      asmfns.WORDREPL '/this/these/is/are/a//string/strings' 'this is not a segmented string'
these are not  segmented strings

      (asmfns.DEB '     This    is      a  segmented   string with   blanks' ' '),'.'
This is a segmented string with blanks.

Example 3: from C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using LC.AsmFns;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            AsmFns asmfns = new AsmFns();
            int[] pos = asmfns.SSFIND("/this/is/a/segmented/string", "/segmented/this");
            string[] strs = asmfns.SStoMAT("/this/is/a/segmented/string");
            string str = asmfns.WORDREPL("/this/these/is/are/a//string/strings", "this is not a segmented string");
            string txt = asmfns.DEB("     This    is      a  segmented   string with   blanks", " ") + ".";
        }
    }
}