Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp50 - Stripping spaces out of text.
Message
De
02/04/1997 08:41:59
 
 
À
01/04/1997 18:31:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00026447
Message ID:
00026535
Vues:
35
>>>>>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
>
>You HAVE checked the length of the field in the file itself I trust. I'm betting that the field length in the file in the DE of the form is 7 char long. As far as the ALLTRIM, there have been times when (for whatEVER reason) it refused to work properly in a SQL. Yeah, it's a pain, but hey....
>
>What does table_fld look like?

table)fld is 254 characters long. It will work when I say
WHERE 'MODEM' $ table_fld
but.. when I replace 'MODEM' with THISFORM.fld.VALUE, it will not work..

help
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform