Consultor Eletrônico



Kbase P82447: How to to delete an entry from a comma-separated character string ?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   28/01/2005
Status: Unverified

GOAL:

How to to delete an entry from a comma-separated character string ?

FIX:

You may use a code like this:


DEFINE VARIABLE myString AS CHARACTER NO-UNDO.
myString = "one,two,tree,four,five".

/*Assuming you want to delete the entry 3*/

SUBSTRING(myString, INDEX ( myString , ENTRY(3, mystring)) ,
(LENGTH (ENTRY(3, mystring))) + 1) = "".

MESSAGE myString
VIEW-AS ALERT-BOX INFO BUTTONS OK.