time delay within a loop
20 posts
• Page 2 of 2 • 1, 2
Re: time delay within a loop
Hi Stu,
You can just add the Style property:
Regards,
Vince
You can just add the Style property:
IB←'Button' ' ? '(90 17)('Event' 'Select' 'RAND')('style' 'check')
'APP.IR'⎕WC IB
Regards,
Vince
- Vince|Dyalog
- Posts: 413
- Joined: Wed Oct 01, 2008 9:39 am
Re: time delay within a loop
Thanks! That's exactly what I wanted.
-Stu
-Stu
- Stu
- Posts: 97
- Joined: Thu Dec 31, 2015 1:30 am
Re: time delay within a loop
The "xshapes" GUI I included in my May 4 post works fine; however, I can't start it up without the session window also starting up. I've tried ⎕LX←'⎕DQ''.''' and ⎕LX←'⎕DQ''#''', but these don't prevent the session window from appearing. What am I not doing, or doing wrong?
- Stu
- Posts: 97
- Joined: Thu Dec 31, 2015 1:30 am
Re: time delay within a loop
If you don't want the session to appear you can use the runtime interpreter, dyalogrt.exe.
Be warned though that errors cannot be dealt with as there is no session!
Be warned though that errors cannot be dealt with as there is no session!
- DanB|Dyalog
Re: time delay within a loop
If I wanted to share one of my workspaces with other APL users, would it be better to just forget about ⎕LX←'⎕DQ''.''' and ⎕LX←'⎕DQ''#''' and the runtime interpreter? Other users could just minimize the session window themselves if they didn't want it, or they could leave the session window open to see my code if they wanted to do that.
- Stu
- Posts: 97
- Joined: Thu Dec 31, 2015 1:30 am
Re: time delay within a loop
Hi Stu
I think that the State property of ⎕se will help ..
Where ever possible I always define a function called "lx" and then set
So I would have something like
I'd also be very careful about using ⎕OFF to terminate the application .. it is so easy to call ⎕off _before_ remembering to save your work .. I'd rather not think about how many times I've done that ! So if you are going to call ⎕off to terminate the application, I would be inclined to write a cover function which prompts you before terminating the APL process.
I think that the State property of ⎕se will help ..
Where ever possible I always define a function called "lx" and then set
⎕lx←'lx'rather than setting up a complex ⎕lx expression: it's easier to amend the function, and allows me to extend what happens when the workspace is loaded. Sticking with the same name makes it easier for me and others to work out what the workspace does !
So I would have something like
∇lx
⎕se.⎕ws'State' 1
'f'⎕wc'Form'
⎕dq'f'
∇
⎕lx←'lx'
I'd also be very careful about using ⎕OFF to terminate the application .. it is so easy to call ⎕off _before_ remembering to save your work .. I'd rather not think about how many times I've done that ! So if you are going to call ⎕off to terminate the application, I would be inclined to write a cover function which prompts you before terminating the APL process.
-
AndyS|Dyalog - Posts: 257
- Joined: Tue May 12, 2009 6:06 pm
Re: time delay within a loop
In case this is helping, you can use the following to 'Show' and 'Hide' the session:
- Code: Select all
HideSession;handle;ShowWindow
handle ← '⎕SE' ⎕WG 'handle'
⎕NA 'I4 user32 | ShowWindow P I4'
{}ShowWindow handle 0
- Code: Select all
ShowSession;handle;ShowWindow
handle ← '⎕SE' ⎕WG 'handle'
⎕NA'I4 user32 | ShowWindow P I4'
{}ShowWindow handle 1
-
PGilbert - Posts: 436
- Joined: Sun Dec 13, 2009 8:46 pm
- Location: Montréal, Québec, Canada
Re: time delay within a loop
Hi Andy,
I don't know how to use the piece of code you suggested:
∇lx
⎕se.⎕ws'State' 1
'f'⎕wc'Form'
⎕dq'f'
∇
It creates an empty form that I have to close before I can use the little GUI I built for my application. Could you briefly explain how this works?
Thanks!
-Stu
I don't know how to use the piece of code you suggested:
∇lx
⎕se.⎕ws'State' 1
'f'⎕wc'Form'
⎕dq'f'
∇
It creates an empty form that I have to close before I can use the little GUI I built for my application. Could you briefly explain how this works?
Thanks!
-Stu
- Stu
- Posts: 97
- Joined: Thu Dec 31, 2015 1:30 am
Re: time delay within a loop
Stu
I may have been rather opaque in my post .. sorry !
My code snippet was to show how you might write a very simple application which runs with a minimised session, waits for some input (in this case, for you to close the form) and then terminates - in production I would have a ⎕OFF as the last line of the function (actually, I would have ⎕off 10 (see more inthis forums post)). So for your applicaton you should replace the two lines
I may have been rather opaque in my post .. sorry !
My code snippet was to show how you might write a very simple application which runs with a minimised session, waits for some input (in this case, for you to close the form) and then terminates - in production I would have a ⎕OFF as the last line of the function (actually, I would have ⎕off 10 (see more inthis forums post)). So for your applicaton you should replace the two lines
'f'⎕wc'Form'with a call to your application.
⎕dq'f'
-
AndyS|Dyalog - Posts: 257
- Joined: Tue May 12, 2009 6:06 pm
Re: time delay within a loop
Problem solved!
Thanks.
-Stu
Thanks.
-Stu
- Stu
- Posts: 97
- Joined: Thu Dec 31, 2015 1:30 am
20 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group