Trapping 'OFF'
Started by Rick San Soucie, Mar 25 2004 10:20 PM
18 replies to this topic
#1
Posted 25 March 2004 - 10:20 PM
I want to be able to record logon times for my users. I am able to record data into a statistics table when they logon.
If they are timed out, I can update the statistics table with the logoff information using the Timeout function.
However, if a user types "OFF" at a menu, I cannot figure out how I can update my statistics from within the same logon session. I cannot replace the OFF command, as it seems to be built into the kernel, and is not a separate function (V4.6).
Any suggestions?
If they are timed out, I can update the statistics table with the logoff information using the Timeout function.
However, if a user types "OFF" at a menu, I cannot figure out how I can update my statistics from within the same logon session. I cannot replace the OFF command, as it seems to be built into the kernel, and is not a separate function (V4.6).
Any suggestions?
#4
Posted 26 March 2004 - 03:11 AM
Hi,
Two solutions....
Change the way you are gathering your stats, and use the TRACE??? (at low levels) or PRORUNSTAT vars before you login to ProIV and then analyse the trace files
or
Create a function that 'mimics' the ? prompt. Then your mimic program can catch them typing OFF and log it. You would have to set @DFUNCT to your mimic function on login of ProIV, so that when the uses did a CTRL-C it would run your mimic program.
HTHs,
Rob D
Two solutions....
Change the way you are gathering your stats, and use the TRACE??? (at low levels) or PRORUNSTAT vars before you login to ProIV and then analyse the trace files
or
Create a function that 'mimics' the ? prompt. Then your mimic program can catch them typing OFF and log it. You would have to set @DFUNCT to your mimic function on login of ProIV, so that when the uses did a CTRL-C it would run your mimic program.
HTHs,
Rob D
#5
Posted 26 March 2004 - 10:46 AM
As I recall the OFF "command" is softcoded in ProIV and you can change this to be any other string (not one that is a Function name as the Function will stop executing).
This is done in the general screen that lets you change the ProIV standard prompts. It was in MSGF at one time.
Then you can write a Function called OFF that will be activated when the user types OFF. (Remember to create one called off too - as the command is not case sensitive but Function names are.)
I recall having good fun with this in the past!!!!!
This is done in the general screen that lets you change the ProIV standard prompts. It was in MSGF at one time.
Then you can write a Function called OFF that will be activated when the user types OFF. (Remember to create one called off too - as the command is not case sensitive but Function names are.)
I recall having good fun with this in the past!!!!!
#6
Posted 04 August 2004 - 05:07 PM
Rick,
I think you need to "rename" the inbuilt OFF/off command by changing the system literal to something else (see Principles & Practice doc. Appendix D) - then you should be able to write your own OFF/off function(s).
Caveat: I haven't tried this.
HTH.
I think you need to "rename" the inbuilt OFF/off command by changing the system literal to something else (see Principles & Practice doc. Appendix D) - then you should be able to write your own OFF/off function(s).
Caveat: I haven't tried this.
HTH.
Nothing's as simple as you think
#7
Posted 04 August 2004 - 05:37 PM
Rick,
You must be somehow linking the user typing off in the menu to the OFF function.
For example if you are using the old ASC code, there must be an entry for OFF in LYNX. You could just change the link.
Or, do you let your end users go to the kernel prompt?
Regards,
Joseph
You must be somehow linking the user typing off in the menu to the OFF function.
For example if you are using the old ASC code, there must be an entry for OFF in LYNX. You could just change the link.
Or, do you let your end users go to the kernel prompt?
Regards,
Joseph
#8
Posted 05 August 2004 - 09:42 AM
Thanks to Richard (and extra thanks for calling me yesterday with the answer!). Sorry for starting another thread.
I've just checked that the code works for me.
The "OFF" string is part of the System Literals. You can redefine it to any other string using the procedure outlined in Appendix D of the Principles and Practice document (download from the www.proiv.com website).
When you have redefined OFF you can write a Function named OFF that will be executed when you link to OFF. Then you don't have to change any existing code but you can do exit processing.
Note the following points though:
1) If you are using the standard ProIV Logon screen then your "exit string" should be 3 characters to allow it to be entered - as entering OFF will not work!
2) Read the notes about creating blank messages in @LITERAL, OFF is message 028 but you must have messages 001 - 027 defined otherwise it will not work!
3) If you have CTL-C enabled then remember that although the exit string is not case sensitive ProIV Functions are. So you need to copy your function to "off" as well as "OFF" (and potentially to "Off" etc too!).
If you are only exiting from defined Functions then just OFF will probably be OK .
4) Remember your Function OFF must link the the new "exit string"!!!!!!!!
HTH.
I've just checked that the code works for me.
The "OFF" string is part of the System Literals. You can redefine it to any other string using the procedure outlined in Appendix D of the Principles and Practice document (download from the www.proiv.com website).
When you have redefined OFF you can write a Function named OFF that will be executed when you link to OFF. Then you don't have to change any existing code but you can do exit processing.
Note the following points though:
1) If you are using the standard ProIV Logon screen then your "exit string" should be 3 characters to allow it to be entered - as entering OFF will not work!
2) Read the notes about creating blank messages in @LITERAL, OFF is message 028 but you must have messages 001 - 027 defined otherwise it will not work!
3) If you have CTL-C enabled then remember that although the exit string is not case sensitive ProIV Functions are. So you need to copy your function to "off" as well as "OFF" (and potentially to "Off" etc too!).
If you are only exiting from defined Functions then just OFF will probably be OK .
4) Remember your Function OFF must link the the new "exit string"!!!!!!!!
HTH.
#9
Posted 09 August 2004 - 09:01 AM
Hi
Many years ago I recollect that when running PRO-IV on a unix system (Bull machine) the System Administrator was in Unix in SuperUser mode and running a pro-iv application. On deciding to quit the pro-iv application types "off" a couple of times (just to be sure), once got him out of pro-iv and the second "off", now out at the unix command prompt, was immediate shutdown (poweroff) of the box !!!! funny now, but was not when it occurred. I also recollect it occurring on a couple of client sites.
Therefore in assigning function names / scripts / commands etc., try and ensure these Names are somewhat Unique
George
Many years ago I recollect that when running PRO-IV on a unix system (Bull machine) the System Administrator was in Unix in SuperUser mode and running a pro-iv application. On deciding to quit the pro-iv application types "off" a couple of times (just to be sure), once got him out of pro-iv and the second "off", now out at the unix command prompt, was immediate shutdown (poweroff) of the box !!!! funny now, but was not when it occurred. I also recollect it occurring on a couple of client sites.
Therefore in assigning function names / scripts / commands etc., try and ensure these Names are somewhat Unique
George
#14
Posted 01 February 2006 - 06:21 PM
Neat Idea,
It looks Kevin is promoting an improvisational form of posting to the proivrc site.
Its been a while, but I beleive at one site we had to completely rewrite our user interface because all of the users s...
Just add some more to the story where ever someone leaves off.
It looks Kevin is promoting an improvisational form of posting to the proivrc site.
Its been a while, but I beleive at one site we had to completely rewrite our user interface because all of the users s...
Just add some more to the story where ever someone leaves off.
Reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users