Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    6

    Unanswered: exit code status ( Urgent )

    Hai all
    I am calling 4gl program from another 4gl program .
    How to handle the exit codes status , i am getting exit code in terms multiples of 256 .

    Please help me

    regs

    puspa

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    780
    Hi,

    The RUN statement suspends the 4GL program and invokes the command.
    The command has complete control of the screen for the duration of its execution.
    For example, the RUN statement can start up a command interpreter
    to execute a batch file or to start an interactive session with the user.
    When the operating system command terminates, the 4GL program resumes.
    You can use the RETURNING clause to capture the exit status of the command.
    You can also use the WITHOUT WAITING clause to run a command in the
    background while the 4GL program continues to execute.

    Gustavo.

  3. #3
    Join Date
    Jun 2004
    Location
    Madrid, Spain
    Posts
    47
    Hi,

    It was an anoying feature of the old 4GL versions. It should be fixed in newer versions. Anyway the workaround is to divide the resulting value by 256. I'd put some kind of control on the value to asure compatibility when you migrate your 4GL version, like in:

    if abs(returncode)>256 then
    returncode=returncode/256
    end if

    Hope it helps.
    José Luis Matute.

    Regards from Spain.

Posting Permissions

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