For Programmers: Free Programming Magazines  


Home > Archive > APL > June 2005 > Run APL function on DoS Command line









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Run APL function on DoS Command line
brookmeade

2005-06-01, 7:36 pm

Hi APL experts,

I am using APL+Win 3.6 on Windows 2000/XP. I want to run an APL function on the DOS command line (without opening the application window).

On a DOS command line now I can do the following:
c:\path\aplw "c:\aplwin36\tools\myWorkSpace.w3" 200M

What I actually want to do is to run a function, which is defined in the workspace and takes one parameter. Eventually I want to run this in a script.

How can I achieve this? Please help!

Larry
AA2e72e

2005-06-03, 11:08 am

I think that 3.5 supports automation.

1. Copy this code & paste it in a text file.

set apl = createobject("APLW.WsEngine")
apl.SysCommand "load c:\Myws"
apl.Call "MyFn", 100
set apl = nothing

2. Change the workspace name, function name and argument as required.
3. Save the text file with extension VBS e.g. APL.vbs
4. Type the file name at the command prompt & press enter or double click on the file name from within explorer.
brookmeade

2005-06-03, 11:33 am

Thanks AA2e72e for your reply!

Yes. I did exactly the same as you described below. It worked!
By the way, the APL 3.5 (or later) tech doc has more details on how to use APL+Win as an ActiveX Server to achieve this.

Thanks again!

quote:
Originally posted by AA2e72e
I think that 3.5 supports automation.

1. Copy this code & paste it in a text file.

set apl = createobject("APLW.WsEngine")
apl.SysCommand "load c:\Myws"
apl.Call "MyFn", 100
set apl = nothing

2. Change the workspace name, function name and argument as required.
3. Save the text file with extension VBS e.g. APL.vbs
4. Type the file name at the command prompt & press enter or double click on the file name from within explorer.

AA2e72e

2005-06-03, 12:24 pm

The code sample I gave you is using APL+Win as an ActiveX server!

The Scripting Engine is the CLIENT and APL+Win is the SERVER.

Unfortunately, APL+Win as an ActiveX server has different syntax depending on whether the client is APL+Win (or another APL) or not APL. For a non apl client, things get a bit tenuous because of the differences in ANSI & AV but you do have the advantage that there is only one APL+Win session.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com