RE: Free form defined Java procedure

Robert Wanless <rwanless-c+ID4+1mkFFWk0Htik3J/[email protected]>
Newsgroups gmane.comp.lang.as400.java
Message-ID <BN7PR04MB4116437018DF465AC6BE1312AFA80@BN7PR04MB4116.namprd04.prod.outlook.com>
It was a combination of the two things, I typed the object name like David mentioned and I needed to add Dim(2) after the Like statement to get it to work. Not quite sure why I needed the dim(2) there as Values is already defined as an array but I'll take it. Thank you for the help. 😊 

-----Original Message-----
From: JAVA400-L <[email protected]> On Behalf Of David Gibbs via JAVA400-L
Sent: Thursday, January 14, 2021 2:43 PM
To: Java Programming on and around the IBM i <[email protected]>
Cc: David Gibbs <[email protected]>
Subject: Re: Free form defined Java procedure

You typo'ed the class name for String...

Object(*Java:'jav.lang.String')

should be

Object(*Java:'java.lang.String')

david

On Thu, Jan 14, 2021 at 1:23 PM Robert Wanless <[email protected]> wrote:
>
> Hello,
>
> I'm trying to code my method call in all free but I'm getting the error NoSuchMethodError when the program tries to call it. I know it's not a class path error and that it does exist because I have codded it in fixed format and it calls the method just fine. This is what I have, could anyone help me out with what I have defined incorrectly please?
>
> Java Code:
> public class SignatureGenerator3
> {
> public static String[] genSignedvalues(String PString1, String 
> PString2, String PString3, String PString4) {
>                                 ...
> }
> }
>
> Fixed format:
> d genSig          PR              O   EXTPROC(*JAVA:
> d                                                'SignatureGenerator3':
> d                                                'genSignedvalues')
> d                                                STATIC
> d                                                CLASS(*JAVA:'java.lang.String')
> d                                                dim(2)
> d PassString1                   O    CLASS(*JAVA:'java.lang.String')
> d                                                Const
> d PassString2                   O    CLASS(*JAVA:'java.lang.String')
> d                                               Const
> d PassString3                   O  CLASS(*JAVA:'java.lang.String')
> d                                                Const
> d PassString4                   O  CLASS(*JAVA:'java.lang.String')
> d                                               Const
>
> Free Format:
> Dcl-Pr genSig Like(Values) Static
>                         EXTPROC(*Java:'SignatureGenerator3':'genSignedvalues');
>      PassString1    Object(*Java:'jav.lang.String') CONST;
>      PassString2    Object(*Java:'jav.lang.String') CONST;
>      PassString3    Object(*Java:'jav.lang.String') CONST;
>      PassString4    Object(*Java:'jav.lang.String') CONST;
> END-PR;
>
> Dcl-S values Object(*Java:'java.lang.String') Dim(2);
>
> Thanks,
> Robert.
>
> --
> This is the Java Programming on and around the IBM i (JAVA400-L) 
> mailing list To post a message email: [email protected] To 
> subscribe, unsubscribe, or change list options,
> visit: 
> https://urldefense.com/v3/__https://lists.midrange.com/mailman/listinf
> o/java400-l__;!!JywAMcrl3w!omjKG-KKxIz4oUcwrkmogGOYtNhgMCJuJKtWrqKksP5
> rB05akVcfwDT4nj8qYELv$ or email: [email protected]
> Before posting, please take a moment to review the archives at 
> https://urldefense.com/v3/__https://archive.midrange.com/java400-l__;!!JywAMcrl3w!omjKG-KKxIz4oUcwrkmogGOYtNhgMCJuJKtWrqKksP5rB05akVcfwDT4nksrMXgP$ .
>
> Help support midrange.com by shopping at amazon.com with our affiliate
> link: 
> https://urldefense.com/v3/__https://amazon.midrange.com__;!!JywAMcrl3w
> !omjKG-KKxIz4oUcwrkmogGOYtNhgMCJuJKtWrqKksP5rB05akVcfwDT4nvSFgj2M$



--
IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding in the American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness.
You can make a tax-deductible donation to my ride by visiting https://urldefense.com/v3/__https://mideml.diabetessucks.net__;!!JywAMcrl3w!omjKG-KKxIz4oUcwrkmogGOYtNhgMCJuJKtWrqKksP5rB05akVcfwDT4nkfoGA2m$ .

You can see where my donations come from by visiting my interactive donation map ... https://urldefense.com/v3/__https://mideml.diabetessucks.net/map__;!!JywAMcrl3w!omjKG-KKxIz4oUcwrkmogGOYtNhgMCJuJKtWrqKksP5rB05akVcfwDT4nn7K-fbP$  (it's a geeky thing).

I may have diabetes, but diabetes doesn't have me!
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options,
visit: https://urldefense.com/v3/__https://lists.midrange.com/mailman/listinfo/java400-l__;!!JywAMcrl3w!omjKG-KKxIz4oUcwrkmogGOYtNhgMCJuJKtWrqKksP5rB05akVcfwDT4nj8qYELv$
or email: [email protected]
Before posting, please take a moment to review the archives at https://urldefense.com/v3/__https://archive.midrange.com/java400-l__;!!JywAMcrl3w!omjKG-KKxIz4oUcwrkmogGOYtNhgMCJuJKtWrqKksP5rB05akVcfwDT4nksrMXgP$ .

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://urldefense.com/v3/__https://amazon.midrange.com__;!!JywAMcrl3w!omjKG-KKxIz4oUcwrkmogGOYtNhgMCJuJKtWrqKksP5rB05akVcfwDT4nvSFgj2M$ 
-- 
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.