Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP!!!!

Status
Not open for further replies.

prija

Programmer
Oct 17, 2002
28
YU
Hi!
I have one problem. From one 4ge program, I run second 4ge, and I want to returning a number from second 4ge. I do this:
***** first 4ge
database baza
globals
define
ret_num integer
.
.
.

main
call funct1()


funct1()
run "sec_4ge.4ge" returning ret_num

display ret_num
end funct

**** second 4ge

database baza
globals
define pass_num integer
end globals

main
call proc1()
.
.
.


function proc1()

let pass_num=255
exit program pass_num

end function
---------------------------
When I start program, ret_num <> pass_num ????
Help me !!!!
Thanks all.

But ret_num <> pass_num
 
Hi:

Some versions of 4GL multiply the return value by 256. Try this:

run &quot;sec_4ge.4ge&quot; returning ret_num
if ret_num >= 256 then let ret_num = return_num/256 end if

Regards,

Ed
 
I do this, but...
Start from 1 to 128, I recived a good number
From 129 to 256, I recived a negative number ???
(for 129 i recive -127 ???; 130 -126;) that look like this:
recive number=256 - send number.
for 256 I recive 0, and after that, from
257,258,259 ..., I start to recive 1,2,3,... to 128, and than again a negative number, and again,again.
Try this, and help me again
Regards,
Prija
 
I have run into a similar problem before. Try changing the data type from an integer to a decimal. If you don't want any trailing 0's, just format it like this decimal(6,0).

Dodge20
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top