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



What you are want is a tokenizer.  Here is a greate sample of one from Scott 
Klement, http://archive.midrange.com/rpg400-l/200408/msg00372.html


Thank you,
Matt Tyler
WinCo Foods, LLC
mattt@xxxxxxxxxxxxxx

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On 
Behalf Of Mohammad Tanveer
Sent: Wednesday, December 14, 2005 9:50 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: Function to split string into array 

Is there any function to split a string into Array?

Something Like Array = SPLIT('abc,def,lkm':',') 

Thanks


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of HauserSSS
Sent: Wednesday, December 14, 2005 8:37 AM
To: RPG programming on the AS400 / iSeries
Subject: AW: Function to repeat Char n times >

If you know, you want to fill 5 * into one field, why not simply:
MyField = '*****';

If you don't want to use this, you can use the solutions you already got.

If you are already on release V5R3M0, you also can use the SQL Scalar
Function REPEAT:
C/EXEC SQL  :MyField = Repeat('*', 5)
C/END-EXEC

Birgitta

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von Luqman
Gesendet: Mittwoch, 14. Dezember 2005 14:10
An: rpg400-l@xxxxxxxxxxxx
Betreff: Re: Function to repeat Char n times >


I could not understand this, is this a RPG 400 Function ?

How can I use this to print '*' 5 times.

A single line of code will be appreciated, please.

Best Regards,

Luqman



<michael@xxxxxxxxxxxxxxxxxx> wrote in message
news:20051214053842.1cba8986f1dca4f8555220876195c2e0.c31ba4494b.wbe@xxxxxxxx
ail.secureserver.net...
*ALL..

*ALL'x..'
Character/numeric fields: Character string x . . is cyclically repeated
to a
length equal to the associated field. If the field is a numeric field,
all
characters within the string must be numeric (0 through 9). No sign or
decimal point can be specified when *ALL'x..' is used as a numeric
constant.
Note: You cannot use *ALL'x..' with numeric fields of float format.
Note: For numeric integer or unsigned fields, the value is never greater
than the maximum value allowed for the corresponding field. For
example, *ALL'95' represents the value 9595 if the corresponding
field is a 5-digit integer field, since 95959 is greater than the
maximum value allowed for a 5-digit signed integer.
Constants
*ALLG'oK1K2i'
Graphic fields: The graphic string K1K2 is cyclically repeated to a
length
equal to the associated field.
*ALLU'XxxxYyyy'
UCS-2 fields: A figurative constant of the form *ALLU'XxxxYyyy'
indicates
a literal of the form 'XxxxYyyyXxxxYyyy...' with a length determined by
the length of the field associated with the *ALLU'XxxxYyyy' constant.
Each
double-byte character in the constant is represented by four hexadecimal
digits. For example, *ALLU'0041' represents a string of repeated UCS-2
'A's.
*ALLX'x1..'
Character fields: The hexadecimal literal X'x1..' is cyclically repeated
to a
length equal to the associated field.
*NULL
A null value valid for basing pointers or procedure pointers
*ON/*OFF
*ON is all ones ('1' or X'F1'). *OFF is all zeros ('0' or X'F0'). Both
are only
valid for character fields.

> -------- Original Message --------
> Subject: Function to repeat Char  n times >
> From: "Luqman" <pearlsoft@xxxxxxxxxxxx>
> Date: Wed, December 14, 2005 4:39 am
> To: rpg400-l@xxxxxxxxxxxx
>
> Which function in RPG ILE repeats the character n Times, like Replicate
> function in Foxpro ?
>
> For example:
> Replicate('*',2) will print '*' 2 times.
>
> Best Regards,
>
> Luqman
>
>
>
> --
> This is the RPG programming on the AS400 / iSeries (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 AS400 / iSeries (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 AS400 / iSeries (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:

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.