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



On Tue, May 24, 2016 at 4:05 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
I actually checked the manual to be sure I wasn’t mismembering before I responded to your post.

None of us, Corel or you or Chuck, is misremembering the manual entry
for XLATE or %XLATE.

What everyone except Corel and Chuck seemed to be missing (I missed it
too) is that you can use it in a clever (and probably unintended) way.

Just checked your code like so:

Dsply %xlate('1234':'12-3=4':'1234’);

Yeah, that's not how you're supposed to use it, in this case. Read
Chuck's post again carefully. And read the Ted Hold article he linked
to as well, if it's taking more time to sink in.

The idea is that the characters in XLATE's "from pattern" are just
sequential placeholders. In order for the patterns to be longer than
10 characters, it's natural to use letters in sequence. (This also
helps clarify in Ted Holt's use case, which was for dates.)

So the pattern 'ABCDEFGHIJ' just means you have 10 placeholders.

Then your *real input* is XLATE's "to pattern" parameter. Kind of
confusing, because it's not the intended use of (%)XLATE, but stick
with it. Let's say it's a phone number: '8005551212'.

Then your *desired output* is in XLATE's "data to translate"
parameter, which in the phone number case might be '(ABC) DEF-GHIJ'.

Try it. You'll like it. ;)

John Y.

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.