Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp50 - Stripping spaces out of text.
Message
De
01/04/1997 19:29:49
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00026447
Message ID:
00026484
Vues:
43
>>>>>>>>How do you strip spaces out from a field value.
>>>>>>>>
>>>>>>>>alltrim(thisform.myfiled.value).. the value is 'modem'
>>>>>>>>
>>>>>>>>when I say..
>>>>>>>>
>>>>>>>>myvar = alltrim(thisform.myfiled.value)
>>>>>>>>
>>>>>>>>myvar is 'modem' but is has two more spaces in it.
>>>>>>>>
>>>>>>>>should have 5 spaces, but it has 7 spaces.
>>>>>>>>
>>>>>>>>what to do?
>>>>>>>
>>>>>>>Come on, ALLTRIM will always trim all heading and trailing spaces.
>>>>>>
>>>>>>my code is..
>>>>>>SELECT * FROM mytable;
>>>>>>WHERE UPPER(ALLTRIM(THISFORM.fld.VALUE)) $ table_fld
>>>>>>
>>>>>>this does not work..but it will work if I...
>>>>>>
>>>>>>WHERE upper('modem') $ table_fld.
>>>>>>
>>>>>>why?
>>>>>
>>>>>Try this:
>>>>>cString=UPPER(ALLTRIM(THISFORM.fld.VALUE))
>>>>>SELECT * FROM mytable;
>>>>>WHERE cString $ table_fld
>>>>
>>>>does not work..
>>>>
>>>>I asked about the spaces because when I check for the len(), it
>>>>shows up as 7. In my test program that does work, the len() shows
>>>>up as 5. The only difference is.. One of my values in the WHERE clause is
>>>>UPPER(ALLTRIM(THISFORM.fld.VALUE)) - does vfp50 have a bug?
>>>>
>>>>thanks
>>>
>>>Do ypu want to say that LEN(cString)=7? Test this line in code?
>>
>>In my test program that works, my len() = 5. In the form that does not
>>work, the len()=7. that should be the same..???
>
>Try STRTRAN(UPPER(ALLTRIM(THISFORM.fld.VALUE)). Your field may have 2 spaces embedded.
>HTH
>Sorin
In your field properties, check the margin property, it might be set to 2. Change it to 0.
L.A.Long
ProgRes
lalong1@charter.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform