Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting carriage return in memo field
Message
 
À
31/07/1998 13:42:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00123123
Message ID:
00123137
Vues:
18
>How can I detect a carriage return that is embedded in a memo field?

Assuming the memo field is named COMMAND and is in the current selected table:

X = AT(CHR(13), COMMAND)

X is the postion of the carrage return in the memo field. If it returns 0 there are no CRs in the memo. You can add the optional parameter (see AT() in help) to move on to others if you want.

If you want to see how many CRs are in the memo use:
X = OCCURS(CHR(13), COMMAND)

I prefer to use AT() if I only want to see if it's there because it will stop at the first occurence and not have to read the entire memo field.

You can then use the STUFF command to remove it/them or add stuff at that point etc. See STUFF() in foxpro help. STUFF is a little complex to get started with but is a great command for things like this.
John.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform