Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create Index Tags using Variables
Message
From
29/11/2002 12:17:40
 
 
To
29/11/2002 11:49:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00728185
Message ID:
00728200
Views:
14
This works in VFP 6 SP5. You can use macro expansion.

example
M.lcMytagname = "TAG1"
m.lcIndexExpr = field(1)+" + "+field(2)
index on &lcIndexExpr tag &lcMytagname
?key()
?tag()

Or 

m.lcIndexexpr = "index on "+indxtable.expr+" tag "+indxtable.tagname
&lcIndexexpr
?key()
?tag()

or 

M.lcMytagname = "TAG1"
m.lcIndexExpr = field(1)
index on &lcIndexExpr tag (m.lcMytagname)
?key()
?tag()

*!* However the following does not seem to work as expected (though I thought it would)
*!* ?key() returns "(m.lcINdexExpr)"

M.lcMytagname = "TAG1"
m.lcIndexExpr = field(1)
index on (m.lcIndexExpr) tag (m.lcMytagname)
?key()
?tag()


 
HTH

>(VFP 7.0 SP1)
>
>Hi,
>
>I would like to create new index tags for tables using tag names and index expressions contained in a table.
>
>The INDEX command will not allow me to use a variable or field reference for the tag name or expression.
>
>Is there a way I can accomplish this?
>
>Thanks
>Gaylen Miller
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform