NetTalk Central

Author Topic: Using RUN command  (Read 4348 times)

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Using RUN command
« on: March 22, 2013, 06:20:20 AM »
Hi,

Is one able to use the RUN command from a NetTalk web server? If so how?

Ashley

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Using RUN command
« Reply #1 on: March 22, 2013, 07:00:04 AM »
Hi Ashley,

yes, it's clarion code, and RUN is a clarion command, so you can call it from the program.

Of course you are subject to all the usual restrictions for RUN (Access Rights, UAC level and so on) just like in any program. Use RUNCODE() to return the error if a RUN command fails.

cheers
Bruce

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Using RUN command
« Reply #2 on: March 22, 2013, 07:00:44 AM »
Ashley,

Sure, I used to do it in the past to Print Documents from reports in another exe, but have moved them since to DLL's.  Something like the following should work, note anything after the exe is just parameters.

!Create Sched at Date of Loss and upload
  k = random(10000000,99999999)
  TheProgram = 'webif.exe '& GLOD:Server &' '& GLOD:Database &' '& c:policyNo &' 1 '& clip(left(format(k,@n_8))) &' 0 '& clip(left(format(C:DateofLoss,@n_8)))
  run(TheProgram,1)

Cheers
Charl

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Re: Using RUN command
« Reply #3 on: March 22, 2013, 07:59:41 AM »
That's great news!! Do you put it in a source procedure and call it from a menu item?


Ashley

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Using RUN command
« Reply #4 on: March 25, 2013, 02:01:07 AM »
Hi Ashley,

the web is "request / response". The browser asks the server something, and gets something in response. In that light;

>> Do you put it in a source procedure and call it from a menu item?

think through this question a bit. What you're suggesting is that the user selects the menu item and
nothing happens. ie there's no feedback to them, no page, no message, no nothing that anything has happened.

so let's turn your question around;
"the users clicks on the menu item, that starts the RUN. Then at the end of the run xxxx happens.'

Tell us more about what xxxx is, and that'll take us to the next step in the answer.

cheers
Bruce

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Re: Using RUN command
« Reply #5 on: March 25, 2013, 03:43:22 AM »
Hi Bruce,

Run(xxxx) is a old service I wrote 4 years ago using the CHT NT Service Template. All I want to have happen is the service to be started and the service to be stopped. Nothing needs to be reported back to the user. The only thing that I would check to see is that the service is running or stopped in Task Manager.

Ashley
 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Using RUN command
« Reply #6 on: March 25, 2013, 05:55:14 AM »
I wouldn't make this a menu item.
I'd make a "memory form" - ie a NetWebform with just buttons on it, and ut code under the button to start and stop the service.

cheers
Bruce