Pass argument to executable
Pass argument to executable
How can we pass argument/parameter to an application made with TD6.2 from command line.
Re: Pass argument to executable
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 ).
Now comes one more question How can I return an outcome back to the command line ( the output ).
Re: Pass argument to executable
SalFileOpen ( hFile, 'CON', OF_Write )
SalFilePutStr ( hFile, 'This is the line' )
?
SalFilePutStr ( hFile, 'This is the line' )
?
Re: Pass argument to executable
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
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
Re: Pass argument to executable
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.
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.
Re: Pass argument to executable
Another way to give an error code from a TD application back to the e.g. DOS promt is:
In DOS you can cath the error code as usal:
if errorlevel YourErrorCode goto ErrorHandler
Regards,
Rainer
Code: Select all
On SAM_AppStartup
! Start an run your application
If EverythingIsOk
Return 0
Else
Return YourErrorCode
if errorlevel YourErrorCode goto ErrorHandler
Regards,
Rainer
Who is online
Users browsing this forum: [Ccbot] and 0 guests