× 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.



All,

d'oh!


-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Mark
Murphy/STAR BASE Consulting Inc.
Envoyé : vendredi 6 août 2010 15:33
À : RPG programming on the IBM i / System i
Objet : Re: Why isn't my %xlate working?

Because %xlate is a character by character translation

message = %XLATE ( '11.11.1111' : %CHAR ( minimumDate ) :
message );
message = %XLATE ( '22.22.2222' : %CHAR ( TodaysDate ) :
message );

is the same as

message = %XLATE ( '11.11.1111' : '01.01.0001' : message );
message = %XLATE ( '22.22.2222' : '06.08.2010' : message
);

1 will translate to a 0 (see first character in the first
Xlate string), 2 will translate to a 0, and . will translate to a .

It is not finding the whole string '11.11.1111' and
translating it to '01.01.0001' you need to use %replace to do that.


Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx



-----rpg400-l-bounces@xxxxxxxxxxxx wrote: -----


To: RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
From: David FOXWELL <David.FOXWELL@xxxxxxxxx> Sent by:
rpg400-l-bounces@xxxxxxxxxxxx
Date: 08/06/2010 08:58AM
Subject: Why isn't my %xlate working?


This must be obvious, but not to me :

User enters a date which must be between 2 dates.

IF DateEntered > TodaysDate OR

DateEntered < minimumDate;

message = 'Use date between 11.11.1111 and 22.22.2222';
// Message returned by a standard error procedure.

message = %XLATE ( '11.11.1111' : %CHAR ( minimumDate ) :
message );
message = %XLATE ( '22.22.2222' : %CHAR ( TodaysDate ) :
message );


ENDIF;


How on earth am I getting this at the end : message = 'Use
date between 00.00.0000 and 00.00.0000' ?

Ps : I realize I don't NEED the xlate function.


Thanks.
--

This is the RPG programming on the IBM i / System i
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.