How to )XLOAD (⎕XLOAD) under program control
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
3 posts
• Page 1 of 1
How to )XLOAD (⎕XLOAD) under program control
Is there a simple way to load a workspace under program control without running the latent expression.
An equivalent of "⎕XLOAD" to ")XLOAD" as "⎕LOAD" is to ")LOAD"
The "-x" option in the APL command line is not an acceptable route.
I have a complicated method (devised in the days of Dyalog version 7, and Windows 3.1) using ")xload" PFkey0 and a simulated key press in the keyboard stack.
This works well under Windows, but I have no equivalent code for Linux. Also it requires "tweaks" with different versions of Windows and Dyalog.
"Why?" you ask.
I use it within some "]UserCommands", dynamically merging workspaces and making backup copies.
(A "-x" option within ⎕LOAD would be great.)
Any suggestions?
An equivalent of "⎕XLOAD" to ")XLOAD" as "⎕LOAD" is to ")LOAD"
The "-x" option in the APL command line is not an acceptable route.
I have a complicated method (devised in the days of Dyalog version 7, and Windows 3.1) using ")xload" PFkey0 and a simulated key press in the keyboard stack.
This works well under Windows, but I have no equivalent code for Linux. Also it requires "tweaks" with different versions of Windows and Dyalog.
"Why?" you ask.
I use it within some "]UserCommands", dynamically merging workspaces and making backup copies.
(A "-x" option within ⎕LOAD would be great.)
Any suggestions?
Ray Cannon
Please excuse any smelling pisstakes.
Please excuse any smelling pisstakes.
-
ray - Posts: 221
- Joined: Wed Feb 24, 2010 12:24 am
- Location: Blackwater, Camberley. UK
Re: How to )XLOAD (⎕XLOAD) under program control
As far as I can tell, x-loading a workspace is equivalent to clearing the current one out, and then copying in a new one. This function, which you'll probably want to keep in ⎕SE, should do the trick:
∆XLOAD←{
⍺←'⎕LX' '⎕SM' '⎕TRAP' '⎕WSID' '⎕TNAME' '⎕CT' '⎕DIV' '⎕IO' '⎕ML' '⎕PP' '⎕RL' '⎕RTL' '⎕WX' '⎕USING' '⎕AVU' '⎕DCT' '⎕FR'
#.(⎕CY ⍵⊣⍺ ⎕CY ⍵⊣⎕EX ⎕NL-⍳10)
}
-
Adam|Dyalog - Posts: 135
- Joined: Thu Jun 25, 2015 1:13 pm
Re: How to )XLOAD (⎕XLOAD) under program control
Do you have to )save the workspaces ? Could you 0 ⎕save them instead ?
The interactions between )save and ⎕save and )load and ⎕save are fairly subtle, but are documented ..
The interactions between )save and ⎕save and )load and ⎕save are fairly subtle, but are documented ..
-
AndyS|Dyalog - Posts: 257
- Joined: Tue May 12, 2009 6:06 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group