|
Walter_Hesius=wRtUmKfndhM@public.gmane.org wrote: > > I'm trying (experimenting) to prototype the apache FOP parser. > This example works fine, but the number of object you can pass, varies. > If i set DIM to a higher value, i get an java exception: > Walter, you have to code a separate array for each number of parameters you want to pass. RPG has no concept of varying dimension arrays, so the RPG compiler always tells Java that the passed array has the declared length. D parms2 s like(newString) D dim(2) D parms3 s like(newString) D dim(3) D parms4 s like(newString) D dim(4) etc. (When you use the LIKE keyword, you don't also code the type (O).) Alternatively, you could code the DIM for the maximum, and pass a place-holder (maybe null strings) in all the unpassed elements. You would have to modify your Java main to handle this. Or you could pass the number of parameters as the first parameter. (I don't know that Java can handle null elements in the String array, but I assume so.) parms(1) = newString(%char(3)); parms(1 + 1) = newString(whatever); parms(2 + 1) = newString(whatever); parms(3 + 1) = newString(whatever); myclassMain (parms);
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.