Re: 4GL question
Posted in 2000
--- "Candy McCall" <candym@olcinc.com> > wrote: >I'm wanting to write a somewhat generic 4gl function >that will return a character string that could anywhere from >1 to 64 characters. I want to pass the number of characters >in the resulting string to the function. Not sure I follow you, but if you're looking for the number of characters in your string to pass to your function try length(charname) where charname is the variable holding the string. >It's use would be something >like the following: > >MAIN > > DEFINE > result2 CHAR(2), > result4 CHAR(4), > result8 CHAR(8), > result16 CHAR(16) > > CALL some_function(2) RETURNING result2 > CALL some_function(4) RETURNING result4 > CALL some_function(8) RETURNING result8 > CALL some_function(16) RETURNING result16 > >END MAIN >FUNCTION some_function(nchar) > > DEFINE nchar SMALLINT, > result CHAR(64) > > .......some code.... > > RETURN result[1,nchar] > >END FUNCTION > > >Do you see any problem with this or know >of a better way to return a variable length >string? > >Thanks in advance! > >Candy >-- >Candy McCall >ONLINE Computing, Inc. >(candym@olcinc.com) == Maintainer of the procrastinator's FAQ. Well, maybe tomorrow I will be. _____________________________________________________________ Want a new web-based email account ? ---> http://www.firstlinux.net