Question how to take output of function

mani tavva

New Member
Hi i want to take output of the following function and i need to validate the output with if statement to assign value to a local variable in browse of se2013 version.

FUNCTION fgettrlamt3 returns logical(input snbr as character, sline as integer ):
define variable i as logical no-undo format "yes/no".
define buffer sdet for sod_det.
define buffer smst for so_mstr.

find first smst where smst.so_nbr = snbr no-lock no-error.
if available smst then
find first sdet where sdet.sod_nbr = smst.so_nbr no-lock no-error.
if sdet.sod_line = sline then
i = yes.
else i = no.
return i.
END.

please help me regarding this thank you
 

andre42

Member
I don't know anything about QAD.
You don't check if sdet is available before accessing sdet.sod_line.
It seems strange to name a logical variable "i", but that's merely a convention.
 

ForEachInvoiceDelete

Active Member
not entirely sure what you want but lets give it a shot.

Hi i want to take output of the following function and i need to validate the output with if statement to assign value to a local variable in browse of se2013 version.

So you want to validate the output of a function? That's not really something you should need help for.... So i think i may have missed the point?

Code:
def var bool as logical.

assign bool = fgettrlamt3("Test",1).

if bool then
do:

    Some Code

end.
else
do:

    Some completely different code.

end.
Bear in mind i dont work with progress anymore and dont have an editor to even check things like syntax. sorry if my code sucks.
 

Cringer

ProgressTalk.com Moderator
Staff member
Your code sucked when you had an editor as well... :p
Only joking of course - your interpretation of the question is the same as mine and if it's correct the OP needs some basics training pretty quickly!
 
Top