Alpha Video Training
Results 1 to 3 of 3

Thread: Run an external program from Alpha5

  1. #1
    Member
    Real Name
    Jose L Garcia
    Join Date
    Sep 2007
    Posts
    13

    Default Run an external program from Alpha5

    Hi I'm new to Alpha5 xbasic...

    I would like to set up a script which will run an external program by clicking a button on a form.

    I would like to use the value in field (Jobnum) as the program file name. (Jobnum is a character field on the form.) See the below..

    The error I’m getting from the pst.exe program is “file (.pst) is not a valid job” the file name value should be” 13693.pst” but for some reason this code is only producing (.pst) Any help is greatly appreciated. Thanks


    DIM file_name AS C
    file_name = runjob->Jobnum
    path = "c:\jobs\\"
    pfile_name = path +chr(92) + file_name +".pst"

    'Open program: c:\test\pst.exe
    if file.exists("c:\test\pst.exe") then
    sys_shell_wait("c:\test\pst.exe pst/a c:\jobs\\" +pfile_name,.T.)
    else
    ui_msg_box("Error Opening Program","File c:\test\pst.exe ' does not exist.",ui_stop_symbol)
    end if

  2. #2
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,644

    Default Re: Run an external program from Alpha5

    Jose

    Looks like a couple of things can be happening...

    What I like to do with something like this is use the debug(1) command to help me trace through the steps.

    Add that line to the beginning of the script and when the debug window shows the code, right click on a variable name and watch what is actually being stored there...


    Welcome to the Alpha world...
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  3. #3
    Member
    Real Name
    Jose L Garcia
    Join Date
    Sep 2007
    Posts
    13

    Default Re: Run an external program from Alpha5

    Thanks so much Al,
    With debug(1) I was able to see the problem. Tha'ts just what I needed.

Similar Threads

  1. running external program
    By lkatz1 in forum Alpha Five Version 5
    Replies: 4
    Last Post: 08-25-2004, 05:36 AM
  2. Calling external program
    By Maciej Neyman in forum Alpha Five Version 5
    Replies: 5
    Last Post: 06-24-2004, 03:41 AM
  3. External program
    By Paul H in forum Alpha Four Versions 7 and 8
    Replies: 8
    Last Post: 02-25-2004, 12:55 PM
  4. Executing an external program
    By Rodger Bailey in forum Alpha Five Version 4
    Replies: 4
    Last Post: 06-09-2000, 12:19 PM
  5. Run Dbase/Foxpro program from alpha5
    By crimmelcp in forum Alpha Five Version 4
    Replies: 1
    Last Post: 04-09-2000, 06:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •