|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
rogerh
Joined: 02 Nov 2014 Posts: 46 Location: Longmont, CO
|
Posted: Mon Apr 06, 2015 11:45 pm Post subject: F95 to Windows? |
|
|
Can F95 tell windows that a key was pressed or that something was typed?
Roger |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7916 Location: Salford, UK
|
Posted: Tue Apr 07, 2015 7:32 am Post subject: |
|
|
It is possible that you need add_keyboard_monitor@.
See the help file for details. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue Apr 07, 2015 1:31 pm Post subject: |
|
|
As in the previous thread you started, there isn't enough information given in the enquiry to allow someone who wants to help you to give you an answer that you might find helpful. Moreover, it isn't clear what your level of expertise is, and thus how much of an explanation you need.
FTN95 (note, not F95, which could be anything) can work in at least four ways:
1. A console application, running in a command window (aka DOS box)
2. A console application running in a Windows setting (WINAPP but no Clearwin+ codes)
3. A Windows application created with Clearwin+
4. A .NET application - also a full Windows application.
Now, we want to know if (a) you want to detect anything in the way of a keypress, or (b) whether you want to detect if a specific key (or key-chord) has been pressed.
Assuming (3) because you mentioned Windows, then in the first case (a), you probably do need to use add_keyboard_monitor@. In the second case, you can incorporate a test for a specific key combination. If I am right about approach (3), then you can add a %ac accelerator key in your WINIO@ calls, but you could also add the test for a specific key combination with add_accelerator@ (and if you wanted, remove it with remove_accelerator@). This may also work if you are using approach (2) above.
If you don't understand what I'm writing about, then you may need to start at a lower level altogether.
Eddie |
|
Back to top |
|
|
rogerh
Joined: 02 Nov 2014 Posts: 46 Location: Longmont, CO
|
Posted: Tue Apr 07, 2015 2:49 pm Post subject: Re: |
|
|
LitusSaxonicum wrote: | As in the previous thread you started, there isn't enough information given in the enquiry to allow someone who wants to help you to give you an answer that you might find helpful. Moreover, it isn't clear what your level of expertise is, and thus how much of an explanation you need. |
Granted. I've been programming since 1970 or so first in Fortran IV then switched to TrueBasic to do graphics. Now I need speed so back to Fortran.
Quote: |
FTN95 (note, not F95, which could be anything) |
Granted but if it was anything else I wouldn't be here.
Quote: |
can work in at least four ways:
1. A console application, running in a command window (aka DOS box)
2. A console application running in a Windows setting (WINAPP but no Clearwin+ codes)
3. A Windows application created with Clearwin+
4. A .NET application - also a full Windows application.
|
2. above. The program will run in Windows under the command of a Perl program, doing the calculations
Quote: |
Now, we want to know if (a) you want to detect anything in the way of a keypress, or (b) whether you want to detect if a specific key (or key-chord) has been pressed.
Assuming (3) because you mentioned Windows, then in the first case (a), you probably do need to use add_keyboard_monitor@. In the second case, you can incorporate a test for a specific key combination. If I am right about approach (3), then you can add a %ac accelerator key in your WINIO@ calls, but you could also add the test for a specific key combination with add_accelerator@ (and if you wanted, remove it with remove_accelerator@). This may also work if you are using approach (2) above.
If you don't understand what I'm writing about, then you may need to start at a lower level altogether. |
Never mind. The problem was solved by someone else who didn't need any of that information. Really, the problem is the documentation here. That's not unusual. Typically in programming documents, the answer is there and the problem is figuring out what it's called.
Roger |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue Apr 07, 2015 5:15 pm Post subject: |
|
|
Hi Roger,
Quite a lot of enquiries on the Forum are for basic Fortran programming, and as far as I know, standards-compliant Fortran has never had a command to allow a user to interrupt program execution at a random place that allowed a restart - PAUSE was under the control of the program. Thus it wasn't necessarily a silly question to ask if F95 in your post meant Fortran 95 or FTN95.
I'm as big a critic of the documentation as anyone, but where to find the answer depends on where you start from, and that wasn't clear in either of your posts.
So you solved the problem independently. Perhaps you'd care to share the answer with us ... was it, may I ask, by reading the documentation? Or have you found something the rest of us missed?
If you were running a Windows program created using FTN95 and Clearwin+ spawned by your Perl program, you could of course send a Windows message from your Perl program to halt the Fortran, but that was never given as an answer because it wasn't stated that the Fortran program was spawned from something else.
Eddie |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Tue Apr 07, 2015 5:15 pm Post subject: |
|
|
Hi Roger,
Quite a lot of enquiries on the Forum are for basic Fortran programming, and as far as I know, standards-compliant Fortran has never had a command to allow a user to interrupt program execution at a random place that allowed a restart - PAUSE was under the control of the program. Thus it wasn't necessarily a silly question to ask if F95 in your post meant Fortran 95 or FTN95.
I'm as big a critic of the documentation as anyone, but where to find the answer depends on where you start from, and that wasn't clear in either of your posts.
So you solved the problem independently. Perhaps you'd care to share the answer with us ... was it, may I ask, by reading the documentation? Or have you found something the rest of us missed?
If you were running a Windows program created using FTN95 and Clearwin+ spawned by your Perl program, you could of course send a Windows message from your Perl program to halt the Fortran, but that was never given as an answer because it wasn't stated that the Fortran program was spawned from something else.
Eddie |
|
Back to top |
|
|
rogerh
Joined: 02 Nov 2014 Posts: 46 Location: Longmont, CO
|
Posted: Tue Apr 07, 2015 11:11 pm Post subject: |
|
|
No, I didn't solve this on my own, I got a lot of help on the other thread, which contains several other suggested solutions and I don't understand some of them.
Part of the confusion is because I'm writing this for someone else and I don't clearly understand what he wants.
Roger |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Thu Apr 09, 2015 2:51 am Post subject: |
|
|
seems you didn't quite get the suggestion on the other post to work - see now what I just posted over there.
DanR's suggestion implements the accelerator key method mentioned by Eddie above.
I'm still not sure you need to 'pause' the program.
If I understood rightly on the other post, what your client wants is:
run a Perl program , which will call a FORTRAN program at some stage to do :
i) some calculations (speed)
ii) some plotting (maybe), or maybe that still done in Perl
IF i) then allow the program to check some plots before carrying on with some other calculations.
I'm not sure wher ethe 'pausing' is needed. Structuring th eprogram in the right way can produce the desired effect.
Call Perl prog
Do some stuff including:
CALL the FORTRAN which
does calcs
does some plots
does some more calcs (or cotinues where it left off above)
does some more plots
DO more stuff in Perl
One thing which mėght be more intricate (not difficult, just intricate) is if you need to 'mix' results of some king produced by Perl with those produced by Fortran.
Whatever, It's clearly not as simple as just 'pausing' the program , which is why others above have asked for more info. about what's needed.
As I mentioned on the other post, you seem to be stuck in the proverbial hardplace, a client asking for vague-ish mods. to do vague-ish things and then expecting a rapid implementation to boot. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|