Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extracting Table names from expression
Message
De
21/07/1997 10:47:13
 
 
À
20/07/1997 12:23:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00040822
Message ID:
00040926
Vues:
35
>
>it is somewhat hard to know where a table name begins in (at least for the examples
>you gave you can find where each name ends with an AT() and other such commands
>if there was a space before each table it would be easier
>note however that what ever you do will also return object names from expressions


If your expression always uses '.' and '*' characters, how about something like this:


lcInput = 'mytable.amount*yourtable.rate*anotherTable.taxes'

DO WHILE LEN(lcInput) >0

*search for the first dot
? substr(lcInput, 1, AT('.', lcInput)-1)

*search for the next table
lnNextTable = AT('*', lcInput)
IF lnNextTable > 0
lcInput = substr(lcInput, lnNextTable+1, LEN(lcInput))
ELSE
lcInput = ''
ENDIF

ENDDO

Claude
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform