Returning PB return code to the calling to CMD environment

We've got a number of PB applications, and I want to return a return 
code back to the OS.  Basically, I want to have a Batch File that 
executes my PB application, gets the return code from the PB app, and 
then performs...

The docs aren't overly clear on how to return a code back to DOS.

Suggestions?

Thanks,
Jason
0
Jason
10/10/2005 10:02:25 PM
sybase.powerscript 7704 articles. 0 followers. Follow

5 Replies
545 Views

Similar Articles

[PageSpeed] 41

Check out the following:

http://groups.google.com/group/comp.soft-sys.powerbuilder/browse_thread/thread/f
1ed7243789fb838/8bede66ec6eced2e?lnk=st&q=powerbuilder+return+code+dos&rnum=1#8b
ede66ec6eced2e


On 10 Oct 2005 15:02:25 -0700,
 in sybase.public.powerbuilder.powerscript
Jason Vogel <jasonvogelremovespam@poboxes.com> wrote: 
>We've got a number of PB applications, and I want to return a return 
>code back to the OS.  Basically, I want to have a Batch File that 
>executes my PB application, gets the return code from the PB app, and 
>then performs...
>
>The docs aren't overly clear on how to return a code back to DOS.
>
>Suggestions?
>
>Thanks,
>Jason
0
Andy
10/11/2005 10:19:30 AM
You can use ExitProcess windows API to return your custom
exit code to the
operation system. This will work for all Windows.


VOID ExitProcess(
    UINT uExitCode      // exit code for all threads
   );


Or you can try just setting message.longparm in the close
event of the app...




> We've got a number of PB applications, and I want to
> return a return  code back to the OS.  Basically, I want
> to have a Batch File that  executes my PB application,
> gets the return code from the PB app, and  then
> performs...
>
> The docs aren't overly clear on how to return a code back
> to DOS.
>
> Suggestions?
>
> Thanks,
> Jason
0
Philip
10/11/2005 8:14:17 PM
Philip Salgannik wrote:
> You can use ExitProcess windows API to return your custom
> exit code to the
> operation system. This will work for all Windows.
> 
> 
> VOID ExitProcess(
>     UINT uExitCode      // exit code for all threads
>    );
> 
> 
> Or you can try just setting message.longparm in the close
> event of the app...
> 
> 
> 
> 
> 
>>We've got a number of PB applications, and I want to
>>return a return  code back to the OS.  Basically, I want
>>to have a Batch File that  executes my PB application,
>>gets the return code from the PB app, and  then
>>performs...
>>
>>The docs aren't overly clear on how to return a code back
>>to DOS.
>>
>>Suggestions?
>>
>>Thanks,
>>Jason

Thanks, I'll give it a try.
0
Jason
10/12/2005 3:52:35 PM
You can also use short PowerBuilder code without the API. Set your exit
code in the close-Event of your application object.

Message.LongParm = 2   // return ERRORLEVEL 2

Hannjo Dybek


Jason Vogel wrote:

> Philip Salgannik wrote:
> > You can use ExitProcess windows API to return your custom
> > exit code to the
> > operation system. This will work for all Windows.
> >
> >
> > VOID ExitProcess(
> >     UINT uExitCode      // exit code for all threads
> >    );
> >
> >
> > Or you can try just setting message.longparm in the close
> > event of the app...
> >
> >
> >
> >
> >
> >>We've got a number of PB applications, and I want to
> >>return a return  code back to the OS.  Basically, I want
> >>to have a Batch File that  executes my PB application,
> >>gets the return code from the PB app, and  then
> >>performs...
> >>
> >>The docs aren't overly clear on how to return a code back
> >>to DOS.
> >>
> >>Suggestions?
> >>
> >>Thanks,
> >>Jason
>
> Thanks, I'll give it a try.

0
Hannjo
10/26/2005 3:39:36 PM
Thanks for translation :-)
I guess this:
>> > Or you can try just setting message.longparm in the close
>> > event of the app...
is not clear enough ...

"Hannjo Dybek @isv-gmbh.de>" <"h.dybek<nosp> wrote in message 
news:435FA22B.F4DC80A@isv-gmbh.de...
> You can also use short PowerBuilder code without the API. Set your exit
> code in the close-Event of your application object.
>
> Message.LongParm = 2   // return ERRORLEVEL 2
>
> Hannjo Dybek
>
>
> Jason Vogel wrote:
>
>> Philip Salgannik wrote:
>> > You can use ExitProcess windows API to return your custom
>> > exit code to the
>> > operation system. This will work for all Windows.
>> >
>> >
>> > VOID ExitProcess(
>> >     UINT uExitCode      // exit code for all threads
>> >    );
>> >
>> >
>> > Or you can try just setting message.longparm in the close
>> > event of the app...
>> >
>> >
>> >
>> >
>> >
>> >>We've got a number of PB applications, and I want to
>> >>return a return  code back to the OS.  Basically, I want
>> >>to have a Batch File that  executes my PB application,
>> >>gets the return code from the PB app, and  then
>> >>performs...
>> >>
>> >>The docs aren't overly clear on how to return a code back
>> >>to DOS.
>> >>
>> >>Suggestions?
>> >>
>> >>Thanks,
>> >>Jason
>>
>> Thanks, I'll give it a try.
> 


0
Philip
10/27/2005 3:34:54 AM
Reply:

Similar Artilces:

How to return return code from PB app.
OK, I have a batch app in PB6.5 that only uses NVO's so no GUI interface. Where do I place the return code RETURN statement in my app so I can read the return code from my job scheduler? I've tried the app close script by I get a compile error - must return from subroutine? Thanks in advance. Hi, Why don't u use the windows registry to write the status from your pb app so that the job schduler can read from it and know what has happened. You should use the registerget and the registryput functions in order to read and write from/to the registry. Cheers, Prasad ...

ConnectToNewRemoteObject return code ... -10 return code
Hello everyone, I have a PB 6.5 client application which uses the ConnectToNewRemoteObject function to connect to a COM object on a remote server. The application is running on a Novell network, with users OS's ranging from Win95,98, NT, & 2000. The application works for most all of my users with the exception of a couple. These few users who don't work have older computers running Win95, with an older Novell client. They get a return error code of -10 from the ConnectToNewRemoteObject function. The help indicates this as "Feature not supported on this platform&...

Why does Web.PB keep calling function that return blobs until the return is null?
Does anybody know a good reason why Web.PB keeps calling a blob returning function until the function returns (null)? I can see how this might be a convienence in some situations but if I designed Web.PB, I wouldn't have thought to do this. The f_retrieve_picture in u_web_examples has a comment that reads: /* Web.pb functions with a blob datatype will be called repeatedly until a Null blob is returned. This is to allow you the ability to stream the amount of data sent back with each request. Once your function has completed its output, return...

Execute Immidiate- returning a return code
We considered creating a dynamic stored procedure wrapper that will dynamically issue using EXECUTE IMMEDIATE commands from a sqlpreview event depending on the event's arguments . As far as I know it's possible to send arguments to the stored proc BUT using the dynamic call EXECUTE IMMEDIATE doesn't enable us to intercept the return code that the stored procedure returns . Any ideas ? If that is so we can't dynamically call stored procedure :-( This is the calling to the stored proc : string ls_parm ls_parm = "exec my_test " EXECUTE IMMEDIATE :ls_...

ct_result return a zero return code after ct_send
ct_result return a zero return code 10 min late after ct_send. then the program do a ct_cancel(CS_CANCEL_ALL). then the program crashed and AIX create a core file. Is the logic correct? There is a Change Request (#369522) that reference the ct_cancel and crash with extended error data. My email address is david.kwa@celero.ca Questions: > Is the logic correct? 1) Should I do a ct_cancel(CS_CANCEL_CURRENT) instead of the ct_cancel(CS_CANCEL_ALL)? 2) Should I do both a ct_cancel(CS_CANCEL_CURRENT) and then a ct_cancel(CS_CANCEL_ALL)? On 19 Nov 2008 13:11:04 -0800, David Kwa...

system calls return code
I am really going crazy here. I have the following system call that I would like to run from perl: "ls *.txt | xargs cat > out" if *.txt does not exist then I expect to get an exit code different from 0. So to test I do: use strict; my $f = "file_which_does_not_exist"; # method 1 print "test 1\n"; qx(ls $f | xargs cat); print $?,"\n"; #method 2 print "test 2\n"; system("ls $f | xargs cat"); print $?,"\n"; Both calls return 0 instead of returning error as 'ls' fails. Help. How do I d...

Web PB calls with no return
I have a web page which contains an anchor <A>...</A> which calls a function in my PB app. The function does a bit of processing but an update to the user's web page is not necessary. I want the current page to remain unchanged. How can I get web-pb to execute the function when the user clicks on the anchor but not jump them to another page? ...

how to return return value?
imagine there was an sp beyond your control (i.e. you cannot use output parameters to obtain the value) but you had to catch the return value submitted by "return <value>" how would you do that? execute returns boolean executeUpdate returns int, but obviously not the return value but rows affected or so what the..? -- pat Hello Pat, For the return value you wills till need to register it as an output parameter, no matter how you execute the sproc. You would need to send the SQL as something like: {? = call sprocName(?, ?, ....)} The for the retu...

Call from jdbc got return 0, but from Jaguar return -6 ??
Hi there, This is weird. I tried to call a stored procedure from Jaguar. I got a return code, -6. I did not have a "-6" in my stored procedure. This must be a system error code or something from Jaguar. With the same stored procedure, I called it from jdbc client without Jaguar using http proxy. I got return code 0, which meant success. I call the stroed procedure in isql. It returned 0 also. The followings are my programs for Jaguar and jdbc. I set the component to "not support transaction" and "auto deactivation". There are inserts and updates in...

Return Code of 55 for CreateInstance Call
I have a PB7 client app which opens a sheet containing the following code: ic_server_connection = Create connection . . ll_rc = ic_server_connection.ConnectToServer() . . ll_rc = ic_server_connection.CreateInstance(iuo_create_report) . . iuo_create_report.Post of_create_report() The constructor event of uo_create_report follows: iuo_report = Create uo_report All of the above code works fine when the user opens one sheet. However, when the user opens a second sheet and the above code executes whi...

return code in PB 6.0
A problem that I found in PB 6.0 is the return code from an event! The events, functions etc that have return code integer or long in PB 5.0 returns (assumes) autmatically 0. But the new version (6.0) it returns (assumes) null. Why!?!?! Some tell me what to do! thanxs for read my message. ...

Null being Returned To PB From Webservice Call
Hi, Powerbuilder 10.5.1.6602 We are at a loss as to what is happening. We have created a project proxy from the wsdl file. We have deployed it creating the appropriate proxy. We have created the application interface to call the webservice function:- lstr_getvendor.companycode = �� lstr_getvendor.vendor = �0006000008� lstr_vendorinfo = lprx_sapweb.TPS_Vendor_OB_Sync_MI(lstr_getvendor) Which it executes the request of (Extract from Log File):- <E:Envelope xmlns:E="http://schemas.xmlsoap.org/soap/envelope/" xmlns:A="http://schemas.xmlsoap.org/soap/...

return/exit code from a PB application
Hi, does anybody know if it is possible to return a value from the application to the operating system just before the application terminates? I'm working with PB 6.5 and the PFC. The close event of the application object has no return value. Any suggestions? Ron, Stuff your code into Message.LongParm just before closing. In the CLOSE event of the app object: Message.LongParm = 99 // Or whatever code you want to return. Tom Ron de Lange wrote: > Hi, does anybody know if it is possible to return a value from the > application > to the operating syst...

how to get a return code from a PB app?
Hi, I am calling a PB app from another PB app. how do I get a return code from the called PB app? Thanks! -Frank You'll have to call with WinAPI calls to launch the program and trap the results. The following works: http://groups.google.ca/groups?q=of_runandwait+group:*.public.powerbuilder.*&hl=en&lr=&ie=UTF-8&selm=9t5940tk0lbunlqm92mmuc4q8jakm8k9tn%404ax.com&rnum=2 Good luck, Terry [TeamSybase] and Sequel the techno-kitten On 1 Sep 2004 12:24:30 -0700, Frank L wrote: >I am calling a PB app from another PB app. how do I get a >return cod...

Web resources about - Returning PB return code to the calling to CMD environment - sybase.powerscript

Environment - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...


Ian Robert Turnbull pleads not guilty to murdering environment officer
The farmer accused of killing environmental&nbsp;officer Glen Turner has pleaded not guilty to murder.&nbsp;


Canada's environment minister worried about rights of indigenous peoples
The Daily Courier (subscription) Canada's environment minister worried about rights of indigenous peoples The Daily Courier (subscription) ...

The challenges of endpoint management in a hybrid environment
As the IT world is changing it's not uncommon for companies to be using a mix of cloud and on-premise solutions. These hybrid environments offer ...

Riverbed Survey: App Performance a Challenge in Hybrid IT Environments
Cloud computing brings its share of benefits and complexities, driving the need for greater visibility into app performance for executives and ...

SungardASVoice: Six Critical Risks That Reside In Healthcare IT Environments
... ability to deliver patient care, ensure resiliency, and protect your reputation. View Identifying the Risks that Reside in Healthcare IT Environments ...

“We’re living in an age when humans have modified just about all aspects of our environment, deliber
“We’re living in an age when humans have modified just about all aspects of our environment, deliberately or accidentally,” said developmental ...

Zillow, Expedia co-founder Rich Barton on the importance of a healthy work environment
Find a big pond to go fishing in and find really talented people to fish with. That was one piece of advice from Rich Barton, the co-founder ...

Resources last updated: 12/12/2015 4:07:19 PM