Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
STRTRANS and Slashes
Message
 
À
10/12/2007 17:08:10
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01274617
Message ID:
01274738
Vues:
9
Is this a situation where we are only talking about slashes in the beginning or the end of the string, and the assumption is that there should ALWAYS be the double slashes .. if so ..

If you want them at the beginning:
ThisForm.DataDir = '\\' + ALLTRIM(This.Value, 0, '\')
If you want them at the end:
ThisForm.DataDir = ALLTRIM(This.Value, 0, '\') + '\\'
>I need to make sure that there are two slashes only in a textbox value. It usually would start with only 1 slash, so it would be increased to two, but over time it was replacing the doubles with 4, etc. This code in the LostFocus seems to work, but I know it's not the best way. Any ideas? Thanks!
>
>
>THISFORM.DataDir = STRTRAN(THIS.Value,'\','\\')
>THISFORM.DataDir = STRTRAN(THIS.Value,'\\\','\\')
>
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform