eric.dizon
19th December 2016, 23:11
I know I am trying to push the limits with this question. I am kind a wishful thinking if it is possible to get multiple results from a function with different data types. This would be possible on OOP type of programming. Is that imposible to do in LN without using tables?
mark_h
20th December 2016, 02:29
Do you have an example? You can do a lot with dynamic sql, but I am having a hard time picturing what you might be specifically asking about.
shah_bs
20th December 2016, 02:42
Not sure about BAAN ERP LN.
But in BAAN IV c3, it would be possible as follows:
The following example is for returning two values
- one is the string representation of the 'next field' (the extern domain tcmcs.str100 string)
- second is the position of that field in the input string (the ref domain tcmcs.long)
By defining as many 'ref' arguments, it is possible to return as many return values as required.
For example, take a look at the Tax Calculation library - I think it is tccomdll0000 or something.
function extern domain tcmcs.str100 tccomdll9003c.get.next.field(
domain tcmcs.s999 i.string.c,
domain tcmcs.long i.string.length.c,
string i.separator.char.c,
ref domain tcmcs.long io.start.pos.c)
{
domain tcmcs.long p.posn.c
domain tcmcs.str100 p.field.c
p.field.c = ""
p.posn.c = io.start.pos.c + 1 |* To skip over the separator character
while p.posn.c <= i.string.length.c
if i.string.c(p.posn.c;1) = i.separator.char.c
then
break
endif
p.field.c = p.field.c & i.string.c(p.posn.c;1)
p.posn.c = p.posn.c + 1
endwhile
io.start.pos.c = p.posn.c
return(p.field.c)
}
eric.dizon
20th December 2016, 03:26
mark_h - I intend to write a function where I can expect two values it will return under the functions section of a DAL or Program script.
shah_bs, That helps a lot as long as I assign corresponding value on the ref variable that I can those values on the instatiating function. Pretty cool!