Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace
Message
De
24/10/2000 13:52:39
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00433677
Message ID:
00433689
Vues:
12
>Why is it that this works:
>use table
>scatter memvar
>replace exceptions.username with "Closed Account " + m.username
>
>but when I do this
>
>replace exceptions.username with m.username + "Closed Account "
>
>I only get the m.username information?
>
>Thanks in advance for your help.

Say the username field is 12 characters long, but the current username is "BOB" - when you SCATTER it,
m.username = "BOB         "
- i.e., PADR("BOB",12)

So when you replace it, only first 12 characters get put in, since that's all that will fit.
Note that you'll also only get the first 12 characters if m.username is last in the expression - it may not appear so, however, unless m.username is long enough to be truncated.

You can do either of the following to join them regardless of righthand spaces:

REPLACE username WITH TRIM(m.username) + "Closed Account"

or

REPLACE username WITH m.username - "Closed Account"
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform