Re: "Run .. returning" & "exit program"
Posted in 1997
In article <63aiqh$sfp@news1.panix.com>, Michael Hoffman <mrh@panix2.panix.com> writes >Hi all, > I stumbled upon a little problem that I'm hoping one of the gurus has >solved in the past. > > I am using Informix 4gl and calling another 4ge program ("run x.4ge >returning y"). The other program passes back an integer ("exit program(a)"). > > The problem: 'y' should equal 'a', correct? Well... it doesn't. >After looking at the data, I found that 'y' actually equals the second 8 bits >of 'a'. >[example: a = 6649 (binary = 00011001 11111001); > y = 63744 (binary = 11111001 00000000); ] > >How do I get around this problem? > Correct, do a man S wait or man 2 wait at the unix prompt. The return value from UNIX is 16 bits wide. The leftmost 8 bits are the lowest 8 bits of the exit() value. The rightmost 8 bits indicate why it stopped e.g. normal exit, Segmententation violation, breakpoint in a debugger (via trace()). run x.4ge returning y let y = y/256. >My system: Informix v. 5.04 on HP-UX 10.01 > >Thanks, >Michael Hoffman >(Yes, Jake, it's me asking another "brilliant" question! :-}) > > -- David Williams