For Programmers: Free Programming Magazines  


Home > Archive > APL > February 2008 > How to create an .exe file









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 How to create an .exe file
Posh

2008-02-04, 7:59 am

Hi,
How can I create an executable of an APL program?
I'm using Dyalog APL/W v11
jk

2008-02-04, 7:59 am

In principle the workspace is an executable, because APL-code is interpreted. If
you mean to distributing an application you'll need a packager (as from
InstallShield) and use the Dyalog Runtime interpreter as the engine
jk

"Posh" <poshasposh@gmail.com> wrote in message
news:0f647ba7-5b30-4334-a74d-a50b790f064a@e4g2000hsg.googlegroups.com...
> Hi,
> How can I create an executable of an APL program?
> I'm using Dyalog APL/W v11



Veli-Matti

2008-02-04, 7:01 pm

Posh wrote:
> Hi,
> How can I create an executable of an APL program?
> I'm using Dyalog APL/W v11


)LOAD the workspace
assign the init function to []LX
(if you are using GUI stuff, remember to []DQ the appropriate
object or '.')

File/Export... the executable file
(you may add the icon file, startup parametres etc.)

Now your app should be ready to be distributed (you need to include
the executable and the Dyalog runtime dll in your distribution package)
IF you have the permission to do so.
Contact Dyalog for the runtime licencing details, if you are not 100%
sure 'bout that.

-Veli-Matti
AAsk

2008-02-05, 7:59 am

A similar question was asked in the APL2000 forum:
http://forum.apl2000.com/viewtopic.php?t=244

If you want to read about it here, the question was:

"I have programmed a model which I want to use on other computers, but
these computers do not have APL. That's why I'd like to make an
executable file of my model. Does anyone know how to do this?"

A good answer was proposed by Brent Hildebrand

"Everyone probably has their own pet way of making a APL+Win runtime
distribution, so here is my way. I take APLWR.EXE, and rename it to
the name of my program, say "MYPROG.EXE". I save my runtime workspace
as MYPROG.W3. I include APL20OCX.DLL. If you want to use the
APLUTIL.DLL or APLDRAW.OCX I include these. I frequently use APL+Win
as a COM object, so I rename APLWRCO.DLL as MYPROGCO.DLL and include
that file. And I include the APLWR.ADF renames as MYPROG.ADF for any
[]WCALL functions. I include a MYPROG.INI if desired.
So for a minimum, I have
MYPROG.EXE (alias for aplwr.exe)
MYPROG.W3 (my APL code)
MYPROG.ADF (alias for aplwr.adf or aplw.adf)
APL20OCX.DLL
and add the following as needed
APLDRAW.OCX
MYPROGCO.DLL (alias for aplwrCo.dll)
APLUtil.dll
MYPROG.INI
Note - you may want other files, data file, bitmap files, other
resources to be included in your distribution depending on your
needs.

Now, to distribute the program, I use INNOSetup (http://
www.jrsoftware.org), a free Setup utility which packages up all the
files as a single executable file. It can also make an uninstall
utility which will show up in Add/Remove program in the Control
Panel.

Note, I believe that the current APL+Win behavior is the same and
APL*Plus/PC, in that the workspace with the same name as the EXE gets
loaded."
Gosi

2008-02-05, 6:59 pm

On Feb 4, 9:10=A0pm, Veli-Matti <veli-matti.jantu...@netsonic.fi> wrote:
> Posh wrote:
>
> )LOAD the workspace
> assign the init function to []LX
> (if you are using GUI stuff, remember to []DQ the appropriate
> object or '.')
>
> File/Export... the executable file
> (you may add the icon file, startup parametres etc.)
>
> Now your app should be ready to be distributed (you need to include
> the executable and the Dyalog runtime dll in your distribution package)
> IF you have the permission to do so.
> Contact Dyalog for the runtime licencing details, if you are not 100%
> sure 'bout that.
>
> -Veli-Matti


I created a ws and a function fun

Assigned fun to quad lx
and exported it as testa

fun asks for input from the session manager and then displays results

When I try to execute testa I get

"The Dyalog APL runtime application has attempted to use the APL
session and will therefor be closed."
jk

2008-02-05, 6:59 pm


"Gosi" <gosinn@gmail.com> wrote in message
news:0576a4a7-6cbf-49a0-8c1c-d3a9a611b08b@i12g2000prf.googlegroups.com...
On Feb 4, 9:10 pm, Veli-Matti <veli-matti.jantu...@netsonic.fi> wrote:[color=darkred]
> Posh wrote:
[color=darkred]
[color=darkred]

you probably don't have a Dyalog interpreter on your pc
veli-matti included the Dyalog Runtime int. and that will be closed
for obvious reasons.

one need to package the necessary Runtime int. + the pertinent WS's


Gosi

2008-02-05, 6:59 pm

On Feb 5, 2:54=A0pm, "jk" <*a...@planet.nl (remove the asterisks)>
wrote:
> "Gosi" <gos...@gmail.com> wrote in message
>
> news:0576a4a7-6cbf-49a0-8c1c-d3a9a611b08b@i12g2000prf.googlegroups.com...
> On Feb 4, 9:10 pm, Veli-Matti <veli-matti.jantu...@netsonic.fi> wrote:
>
>
> you probably don't have a Dyalog interpreter on your pc
> veli-matti included the Dyalog Runtime int. and that will be closed
> for obvious reasons.
>
> one need to package the necessary Runtime int. + the pertinent WS's


Created and tested on the same pc

)LOAD "C:\Windows\system32\testa.DWS"
C:\Windows\system32\testa saved Tue Feb 05 14:08:11 2008
fun

4 5 6 4
5 6 4 5
6 4 5 6

works fine direct but not executable
Veli-Matti

2008-02-05, 6:59 pm


>
> Created and tested on the same pc
>
> )LOAD "C:\Windows\system32\testa.DWS"
> C:\Windows\system32\testa saved Tue Feb 05 14:08:11 2008
> fun
>
> 4 5 6 4
> 5 6 4 5
> 6 4 5 6
>
> works fine direct but not executable


I really skipped some obvious points including:

- you need either to make some kind of GUI and launch it with []DQ '.'
or your executable needs to handle the input and output in some clever
way (I have made batches that start with the executable and some
parametres, the io is always used via text files); in both cases there
MUST be something sensible in the []LX

- you cannot have/use Session (and that's why you got the error message)

- there are (at least) two ways to make runtime apps: either packaging
the workspace to an executable and delivering it with the runtime dll or
just having the Dyalog runtime interpreter with the []LX'ed workspace
(the former method needs a little bit more work to do, but you get a
'standard' Windows solution with dynamic memory handling, the latter is
more or less straighforward way to do the same thing, but you have to
advise the user to launch it with something like
[Drive:][path]DyalogRuntime.exe Application.dws

Hmmm.. reading the manual might be a goood idea here?

Yours
- Veli-Matti
Gosi

2008-02-05, 6:59 pm

On Feb 5, 4:53=A0pm, Veli-Matti <veli-matti.jantu...@netsonic.fi> wrote:
>
>
>
>
>
>
> I really skipped some obvious points including:
>
> - you need either to make some kind of GUI and launch it with []DQ '.'
> or your executable needs to handle the input and output in some clever
> way (I have made batches that start with the executable and some
> parametres, the io is always used via text files); in both cases there
> MUST be something sensible in the []LX
>
> - you cannot have/use Session (and that's why you got the error message)
>
> - there are (at least) two ways to make runtime apps: either packaging
> the workspace to an executable and delivering it with the runtime dll or
> just having the Dyalog runtime interpreter with the []LX'ed workspace
> (the former method needs a little bit more work to do, but you get a
> 'standard' Windows solution with dynamic memory handling, the latter is
> more or less straighforward way to do the same thing, but you have to
> advise the user to launch it with something like
> =A0 =A0 =A0 =A0 [Drive:][path]DyalogRuntime.exe Application.dws
>
> Hmmm.. =A0reading the manual might be a goood idea here?
>
> Yours
> - Veli-Matti


how about just a very simple step by step example what to do to create
a .exe that can be distributed and what files need to be distributed
together with it.

The application should read a file with the content

--------
hello world
-----------

The application then creates and writes a file with the content

----------
goodby world
------------


This is a very standard thing normal computer languages can and do.

I have never seen an APL application been able to do this.

Even J can not do this.

Create an .exe and do the rest, that is.

Not having an .exe has been a major divantage in the APL
environment.
Now being able to do it is Dyalog is really a huge step forward.

Having a very simple description HOW and WHAT to do it is a huge major
step too.

If we had had this feature years ago we would not have been fending
off and dodging the compiler question all the time.
It is not a question of having a compiler it has and is always THE
question: " can you create a .exe? =A8"

If now yes the " HOW? "
microapl@microapl.demon.co.uk

2008-02-05, 6:59 pm

On 5 Feb, 17:20, Gosi <gos...@gmail.com> wrote:

>
> If we had had this feature years ago we would not have been fending
> off and dodging the compiler question all the time.
> It is not a question of having a compiler it has and is always THE
> question: " can you create a .exe? =A8"
>
> If now yes the " HOW? "


I think several APL vendors have supported this for a number of
years. The 'HOW' depends on the APL.

In APLX, the file read/write application you describe is a two-line
function using []IMPORT and []EXPORT. Then you just assign the name
of the function to []LX, and choose "Save as type: Executable
(packaged WS) .exe" from the File Menu. (Incidentally you can use the
session window for output if you want to.)

So it's rather misleading to say "This is a very standard thing normal
computer languages can and do... I have never seen an APL application
been able to do this." I would say "no other programming language
does it as easily as APL!"

Richard Nabavi
MicroAPL

Gosi

2008-02-05, 6:59 pm

On Feb 5, 5:33=A0pm, micro...@microapl.demon.co.uk wrote:
> On 5 Feb, 17:20, Gosi <gos...@gmail.com> wrote:
>
>
>
>
>
> I think several APL vendors have supported this for a number of
> years. =A0The 'HOW' depends on the APL.
>
> In APLX, the file read/write application you describe is a two-line
> function using []IMPORT and []EXPORT. =A0Then you just assign the name
> of the function to []LX, and choose "Save as type: =A0Executable
> (packaged WS) .exe" from the File Menu. =A0(Incidentally you can use the
> session window for output if you want to.)
>
> So it's rather misleading to say "This is a very standard thing normal
> computer languages can and do... I have never seen an APL application
> been able to do this." =A0I would say "no other programming language
> does it as easily as APL!"
>
> Richard Nabavi
> MicroAPL


I have not seen it
It may have been done a long time ago even if I have not seen it.

I still have not seen it and I would like to see a step by step
description on how to do it.

I would not mind do it with APLX either if I can use my national
characters at the same time as the APL chars.
IncidentallY can do that with Dyalog (with Unicode support) now

I only need a short description how to do the above in Dyalog and then
I can say truthfully that I have seen it.

So can I use APLX with out characterproblems?

Obviously I would need to get APLX for free educational use for the
schools if it can do the rest.
Otherwise it is no good to me.

I find it quite exciting that I will soon be able to start use APL for
real again.
Morten Kromberg

2008-02-06, 4:01 am

On Feb 5, 6:59=A0pm, Gosi <gos...@gmail.com> wrote:
> I still have not seen it and I would like to see a step by step
> description on how to do it.


For Dyalog APL, the procedure is described near the beginning of the
"User Guide", page 36 in the manual which accompanies the v12 Beta
(just noticed it erroneously uses the v11 file names still, we'll fix
that ASAP). In a nutshell, File|Export on the session menu. There have
been some problems with this in early Betas but recent ones should be
OK.

> I find it quite exciting that I will soon be able to start use APL for
> real again.


Good to see you back :-)

Morten

microapl@microapl.demon.co.uk

2008-02-06, 4:01 am

On 5 Feb, 17:59, Gosi <gos...@gmail.com> wrote:
>
>
> I still have not seen it and I would like to see a step by step
> description on how to do it.
> ...
> I would not mind do it with APLX either if I can use my national
> characters at the same time as the APL chars.


All the details are on our website (http://www.microapl.co.uk/apl) and
you can also download an evaluation copy of APLX from the MicroAPL
website. The APLX Help file has a whole section on creating and
using .exe ("APLX Standalone Applications"). The character set is
also detailed in the Help file, and in the Language Reference Manual
(http://www.microapl.co.uk/apl/APLXLangRef.pdf).

>
> Obviously I would need to get APLX for free educational use for the
> schools if it can do the rest.


We can usually arrange this for teaching - send us an e-mail.

Richard Nabavi
MicroAPL
Gosi

2008-02-06, 7:58 am

On Feb 5, 4:53=A0pm, Veli-Matti <veli-matti.jantu...@netsonic.fi> wrote:
>
>
>
>
>
>
> I really skipped some obvious points including:
>
> - you need either to make some kind of GUI and launch it with []DQ '.'
> or your executable needs to handle the input and output in some clever
> way (I have made batches that start with the executable and some
> parametres, the io is always used via text files); in both cases there
> MUST be something sensible in the []LX
>
> - you cannot have/use Session (and that's why you got the error message)


Because using quad for input/outout it would be nice to have a console
version for quad.
Strip away the session manager and it will work.

Everything is easy for those who do not need to do the work.
Gosi

2008-02-06, 7:58 am

On Feb 6, 7:00=A0am, Morten Kromberg <mk...@dyalog.com> wrote:
> On Feb 5, 6:59=A0pm, Gosi <gos...@gmail.com> wrote:
>
>
> For Dyalog APL, the procedure is described near the beginning of the
> "User Guide", page 36 in the manual which accompanies the v12 Beta
> (just noticed it erroneously uses the v11 file names still, we'll fix
> that ASAP). In a nutshell, File|Export on the session menu. There have
> been some problems with this in early Betas but recent ones should be
> OK.
>
>
> Good to see you back :-)
>
> Morten


The manual does in fact cover this nicely.
Quite impressive documantation.
Gosi

2008-02-06, 7:58 am

On Feb 6, 9:30=A0am, micro...@microapl.demon.co.uk wrote:
> On 5 Feb, 17:59, Gosi <gos...@gmail.com> wrote:
>
>
>
>
> All the details are on our website (http://www.microapl.co.uk/apl) and
> you can also download an evaluation copy of APLX from the MicroAPL
> website. =A0The APLX Help file has a whole section on creating and
> using .exe ("APLX Standalone Applications"). =A0The character set is
> also detailed in the Help file, and in the Language Reference Manual
> (http://www.microapl.co.uk/apl/APLXLangRef.pdf).
>
>
>
>
> We can usually arrange this for teaching - send us an e-mail.
>
> Richard Nabavi
> MicroAPL


Thank you very much for those references.
They are most impressive.
The Unicode work seems to be a big part too.

At the moment I have my hands full with Dyalog APL so another APL
would probably just confuse me at the moment.

I have installed quite a lot of J in schools and I hope to get the
other APLs there too.

I see the Unicode and .exe facilities as being very important for the
future of APL.
Gosi

2008-02-06, 7:58 am

On Feb 6, 10:12=A0am, Gosi <gos...@gmail.com> wrote:
> On Feb 5, 4:53=A0pm, Veli-Matti <veli-matti.jantu...@netsonic.fi> wrote:
>
>
>
>
>
>
>
>
>
>
>
[color=darkred]
>
> Because using quad for input/outout it would be nice to have a console
> version for quad.
> Strip away the session manager and it will work.
>
> Everything is easy for those who do not need to do the work.


After finally starting to glance at the manual I see that console is
indeed part of the .exe in Dyalog APL.
Sponsored Links







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

Copyright 2008 codecomments.com