Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to put a cursor name to variable

Status
Not open for further replies.

mensud

Programmer
Jul 22, 2001
51
0
0
US
Hello,

I need to put a cursor name into local variable, and also do something with that cursor using variable as name.

Thanks.
Mensud
 
lcVariable = "MyCursor"

...or...

lcVariable = Alias()


...then...

Select (lcVariable) &&There are lots of commands that will take the cursor name as a string

...or you can use macro substitution:

Replace &lcVariable..MyField with "Hello World"

...or in certain circumstances you can use Evaluate:

lcMyString = Evaluate(lcVariable + ".MyField")

...I would encourage you to read the help file or look at intellisense to see which commands can except the alias as a string (most will) and which ones need the literal name. In the latter case macro substitution provides what you need and in the former case you already have a variable that contains the name of your cursor so use it with parenthesis around it.

boyd.gif

[sub]craig1442@mchsi.com[/sub][sup]
"Whom computers would destroy, they must first drive mad." - Anon​
[/sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top