There’s some documentation at 
http://jbase.com/r5/knowledgebase/manuals/3.0/30manpages/man/sup12_I_TYPES.htm.
You need to use a subroutine instead of a function. The type processor expects 
the result to be returned in the first parameter instead of by a RETURN 
statement, and passes the eval arguments to the subroutine as the 2nd and 
subsequent parameters.


> On Sep 28, 2015, at 8:05 AM, Jose L Martinez Avial <[email protected]> wrote:
> 
> Hello,
>   Nobody know if this can be done, and how?
> 
> Thanks
> JL
> 
> Sent from my iPhone
> 
>> On Sep 24, 2015, at 2:58 AM, JOSE L MARTINEZ-AVIAL <[email protected]> wrote:
>> 
>> Hello,
>>  I'm trying to develop a custom function so it can be used with EVAL in a 
>> jbase command. To begin, I tried to create a function that receives just one 
>> argument, as follows:
>> 
>> FUNCTION FTEST(A)
>>   RETURN (A:"-1")
>> END
>> 
>> but if use it with LIST, for example:
>> 
>> jsh miaeco01 ~ -->LIST F.SPF 'SYSTEM' EVAL'FTEST(@ID)'
>> ** Error [ SUBROUTINE_PARM_ERROR ] ** 
>> 'SUBROUTINE FTEST' called with incorrect arguments , Line     1 , Source 
>> jql_listcolumnar.b
>> jsh miaeco01 ~ -->
>> 
>> It gives an error about an invalid number of arguments, so just out of 
>> curiosity I tried the following:
>> 
>> FUNCTION FTEST(A,B)
>>   RETURN (A:"-1")
>> END
>> 
>> And the same command now returns this:
>> jsh miaeco01 ~ -->LIST F.SPF 'SYSTEM' EVAL'FTEST(@ID)'
>> 
>> LIST F.SPF 'SYSTEM' EVAL'FTEST(@ID)'                                         
>>                                                                              
>>                    PAGE    1 02:52:38  24 SEP 2015
>> 
>> @ID...    FTEST(@ID)
>> 
>> SYSTEM    SYSTEM-1  
>> 
>> 1 Records Listed 
>> 
>> jsh miaeco01 ~ -->
>> 
>> I don't know what the second argument is for, because if I try to use in the 
>> function, the LIST crashes
>> FUNCTION FTEST(A,B)
>>   RETURN (A:"-1":B)
>> END
>> 
>> 
>> jsh miaeco01 ~ -->LIST F.SPF 'SYSTEM' EVAL'FTEST(@ID)'
>> jBASE: Segmentation violation. Aborting
>> 
>> Anybody knows about that second argument is, and if I can send more than one 
>> argument to the function?
>> 
>> Thanks!
>> 
>> 
> 
> -- 
> -- 
> IMPORTANT: T24/Globus posts are no longer accepted on this forum.
> 
> To post, send email to [email protected]
> To unsubscribe, send email to [email protected]
> For more options, visit this group at 
> http://groups.google.com/group/jBASE?hl=en
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "jBASE" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
IMPORTANT: T24/Globus posts are no longer accepted on this forum.

To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"jBASE" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to