× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yes, POI is going through the exercise of converting short constants to
enums, so anything that used to be a short will need to be converted in
this manner. Looks like you are doing things correctly. In your program,
you may want to just create the enums that you are going to use rather than
dropping back to Java each time you need to retrieve an enum.

dcl-s HAlignCenter Like(ssHorizontalAlignment);
dcl-s HAlignLeft Like(ssHorizontalAlignment);
dcl-s HAlignRight Like(ssHorizontalAlignment);
...

// Create Enums
HAlignCenter = HorizontalAlignment_valueOf(new_String('CENTER'));
HAlignLeft = HorizontalAlignment_valueOf(new_String('LEFT'));
HAlignRight = HorizontalAlignment_valueOf(new_String('RIGHT'));
...

// Apply the enum to the cell style
ssCellStyle_setAlignment(LgHeading: HAlignCenter);


On Tue, Nov 7, 2017 at 3:45 PM, <RWillis@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Mark
Thanks. Looks like your suggestion is going to work. I modified one of my
programs that only uses setAlignment and setBorder enums and got it to
work properly. I'm guessing I have other programs that will need to be
changed for other enums though, like setFillPattern.
What I have now is;
// enum constant
dcl-c HORIZONTALALIGNMENT_ENUM
'org.apache.poi.ss.usermodel.HorizontalAlignment';

// Class object for HorizontalAlignment enum
dcl-s SSHorizontalAlignment
object(*JAVA: HORIZONTALALIGNMENT_ENUM);

// Prototype for enum 'valueof' method
dcl-pr HorizontalAllignment_valueOf
Like(SSHorizontalAlignment)
ExtProc(*JAVA: HorizontalAlignment_ENUM: 'valueOf')
Static;
value Like(jString) const;
end-pr;

// Progotype for setAlignment
dcl-pr SSCellStyle_setAlignment
ExtProc(*JAVA: CELLSTYLE_CLASS: 'setAlignment');
horizAlign Like(SSHorizontalAlignment) const;
end-pr;

Not sure I implemented the 'valueof' method properly since Java isn't my
strong suite. Maybe you can show me a better way.

D horizAlign s like(SSHorizontalAlignment)
D ALIGN_CENTER s like(jString)
D ALIGN_CENTER_SELECTION...
D s like(jString)
D ALIGN_FILL s like(jString)
D ALIGN_GENERAL s like(jString)
D ALIGN_JUSTIFY s like(jString)
D ALIGN_LEFT s like(jString)
D ALIGN_RIGHT s like(jString)

// Create enum constants for setAlignment
ALIGN_CENTER = new_String('CENTER');
ALIGN_CENTER_SELECTION = new_String('CENTER_SELECTION');
ALIGN_FILL = new_String('FILL');
ALIGN_GENERAL = new_String('GENERAL');
ALIGN_JUSTIFY = new_String('JUSTIFY');
ALIGN_LEFT = new_String('LEFT');
ALIGN_RIGHT = new_String('RIGHT');

// Create the enum value for ALIGN_CENTER
horizAlign = HorizontalAllignment_valueOf(ALIGN_CENTER);

// Apply the enum value to the cell style
ssCellStyle_setAlignment(LgHeading: horizAlign);




______________________________________________________________________
This e-mail and any files transmitted with it may be privileged and
confidential and intended solely for the use of the individual or
entity to which it is addressed. If the reader of this message is
not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
e-mail in error, please notify the sender immediately by replying
to this e-mail and deleting it from your computer.
______________________________________________________________________
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.