Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling programs and logging
Message
From
14/01/2005 10:51:12
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00977203
Message ID:
00977214
Views:
41
>I have a program which is invoked using the following command on a button in the onclick event on a form:
>
>! /n c:\questpdm\questpdm.exe
>
>Prior to this I write a record to a table to state when that user logged in to the system.
>When the user closes the calling program I want to write the datetime when they logged out for the same record. Can this be done?
>
>Here is my code:
>
>
>use userlog
>
>INSERT INTO 'userlog' (pdmuserid, domuserid, datetimei) VALUES (thisform.combo1.displayvalue, SYS(0), DATETIME())
>
>! /n c:\questpdm\questpdm.exe
>
>INSERT INTO 'userlog' (pdmuserid, domuserid, datetimeo) VALUES (thisform.combo1.displayvalue, SYS(0), DATETIME())
>
>
>Obviously from the code above a record is written. But then as soon as its written another record is written. I know this is wrong.
>
>What I would like to do is halt processing on my button until the calling program as closed. In addition I would like to write the datetimeo to the same record instead of writing another record.
>
>Any help would be greatly appreciated.

If you omit the "/n" option from the RUN (or "!") command, VFP will wait for the completion of the external program.

As an alternative, search in the download and FAQ question for relevant Windows API functions. One function I think is relevant is ShellExecute().
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform