Kbase P65616: How to split a string out by words where each word is delimited by a space
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  03/02/2009 |
|
Status: Verified
GOAL:
How to split a string out by words where each word is delimited by a space
FACT(s) (Environment):
All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Language (4GL/ABL)
FIX:
To split a string out in to separate strings (words) where each string (word) is delimited by a space, use code similar to the following:
DEFINE VARIABLE iNumEntries AS INTEGER NO-UNDO.
DEFINE VARIABLE iLoop AS INTEGER NO-UNDO.
ASSIGN iNumEntries = NUM-ENTRIES(SomeString," ").
DO iLoop = 1 TO iNumEntries:
MESSAGE ENTRY(iLoop,SomeString," ") VIEW-AS ALERT-BOX.
END.