-
Hmmm...
weiss net ob das so hinhaut, da ich bei check ja wissen muss nach welchen Trennzeichen gesucht werden soll, diese Zeichen können ja alle möglichen sein.
Oder hab ich das jetzt flasch verstanden?
*..1....+....2....+....3....+....4....+....5....+. ...6....+....7...+....
*--------------------------------------------------
* A string contains a series of numbers separated
* by blanks and/or commas.
* Use %CHECK to extract the numbers
*--------------------------------------------------
D string s 50a varying
D inz('12, 233 17, 1, 234')
D delimiters C ' ,'
D digits C '0123456789'
D num S 50a varying
D pos S 10i 0
D len S 10i 0
D token s 50a varying
/free
// make sure the string ends with a delimiter
string = string + delimiters;
dou string = '';
// Find the beginning of the group of digits
pos = %check (delimiters : string);
if (pos = 0);
leave;
endif;
// skip past the delimiters
string = %subst(string : pos);
// Find the length of the group of digits
len = %check (digits : string) - 1;
// Extract the group of digits
token = %subst(string : 1 : len);
dsply ' ' ' ' token;
// Skip past the digits
if (len < %len(string));
string = %subst (string : len + 1);
endif;
enddo;
/end-free
Similar Threads
-
By robertki in forum NEWSboard Programmierung
Antworten: 25
Letzter Beitrag: 19-01-07, 08:42
-
By Stoeberl in forum NEWSboard Programmierung
Antworten: 8
Letzter Beitrag: 10-01-07, 10:58
-
By jth in forum NEWSboard Programmierung
Antworten: 1
Letzter Beitrag: 21-12-06, 11:13
-
By Alex79 in forum IBM i Hauptforum
Antworten: 4
Letzter Beitrag: 28-07-05, 15:45
-
By hs in forum IBM i Hauptforum
Antworten: 14
Letzter Beitrag: 09-10-01, 12:06
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- You may not post attachments
- You may not edit your posts
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks