Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
sub fnConvToQQ(uniBase,cantBase)
if(match(uniBase,'LTA','FGS','QQ'),cantBase,cantBase*2);
end sub
Hi,
You can't put an if just like that in a subrutine, you need to assign the result to a variable:
let var = if(match(uniBase,'LTA','FGS','QQ'),cantBase,cantBase*2);
uniBase and cantBase are variables or fields? I don't think you can use fields as parameters, they have to be variables
Regards!
Yes, are fields.
And if I need do somethind like this:
let factConv = (load FC FROM vConversion WHERE UMO=uniBase and UMD='QQ);
Hi
This depends on what that load statement is going to return.... if you can guarantee that the load statement will return only one row for that command (i.e. there is only one occurrence of uniBase/QQ in the table) then you can use a simple load statement to load into a table then:
LET factConv = PEEK('FC',0,'TableName');
If there are going to be more than one row returned then you need to be more specific about what you want to to create, if it is simply that you want the FC column value to be called factConv then just do:
LOAD FC AS factConv FROM ....................
But I guess this is not what you need, so let us know what that is and we'll try to help.
SUB fnConvToQQ(uniBase,cantBase)
LOAD FC AS factConv FROM vConversionUM WHERE UMO=uniBase and UMD='QQ');
LET cantReturnQQ = IF(MATCH(uniBase,'LTA','FGS','QQ'),cantBase,cantBase*factConv;
END SUB