Information générale
Catégorie:
Codage, syntaxe et commandes
Brenda,
Is this what you are looking for? HTH...
Bill
* lcString is the string you want to extract the User ID from
* Variables we will need
LOCAL lnPos, lcTmpString
lcTmpString = ""
* See if USERID is in the string
lnPos = AT("USERID", lcString)
IF lnPos > 0
* USERID is in the string, so take everything after it.
lcTmpString = SUBSTR(lcString, lnPos + LEN("USERID"))
* See if we have any spaces in the string, and only take
* up to the space.
lnPos = AT(" ", lcTmpString)
IF lnPos > 0
* There is a space here, so take everything up to the
* space
lcTmpString = SUBSTR(lcTmpString, 1, lnPos - 1)
ELSE
* There is no space, so the User ID goes to the end of the
* string. Nothing to do.
ENDIF
ENDIF
* At this point lcTmpString is empty if there was no user ID,
* or contains the user ID.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement