Pass argument to executable

Discussion forum about all things Gupta, OpenText and the community.
NITOX74

Pass argument to executable

Post by NITOX74 » 30 Sep 2013, 12:07

How can we pass argument/parameter to an application made with TD6.2 from command line.

NITOX74

Re: Pass argument to executable

Post by NITOX74 » 01 Oct 2013, 10:16

Ok, I found the way to retrieve the parameters from the command line using the system array variable strArgArray[*].
Now comes one more question :) How can I return an outcome back to the command line ( the output ).

FRBhote
India
Posts: 2220
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: Pass argument to executable

Post by FRBhote » 01 Oct 2013, 12:18

SalFileOpen ( hFile, 'CON', OF_Write )

SalFilePutStr ( hFile, 'This is the line' )

?

User avatar
markus.essmayr
Austria
Posts: 892
Joined: 06 Mar 2017, 06:07
Location: Austria

Re: Pass argument to executable

Post by markus.essmayr » 01 Oct 2013, 15:22

Hi,

what kind of information do you want to return?
Just a number or some kind of "complex data" (string, ...)?

I'd recommend to pass the name of a file to your application.
Your application could then write results to this file which you can use in a post-processing job.

Max
Markus Eßmayr
teamdeveloper@t-mx.com

NITOX74

Re: Pass argument to executable

Post by NITOX74 » 02 Oct 2013, 09:13

Ok, thank you very much!

I'll follow the advice of creating a file to exchange the variables between our applications.
Plus, big thank you for the command on how to return a value in dos prompt.

RainerE
Germany
Posts: 2256
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: Pass argument to executable

Post by RainerE » 07 Oct 2013, 10:11

Another way to give an error code from a TD application back to the e.g. DOS promt is:

Code: Select all

On SAM_AppStartup
   ! Start an run your application
   If EverythingIsOk
      Return 0
   Else
      Return YourErrorCode
In DOS you can cath the error code as usal:
if errorlevel YourErrorCode goto ErrorHandler

Regards,
Rainer

User avatar
Charlie
Canada
Posts: 652
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: Pass argument to executable

Post by Charlie » 16 Oct 2013, 11:38

Very cool, Rainer. Thanks !

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests