Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refering to a dynamic alias
Message
From
14/09/2004 07:22:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
14/09/2004 07:11:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00941839
Message ID:
00941846
Views:
12
This message has been marked as a message which has helped to the initial question of the thread.
>Hi All
>
>If I create a file using a dynamically created alias how does one refer to the fields of the table in code? For instance, lets say I create a cursor and use a variable for the cursor name.
>
>
>cMyAlias = "MyFileXYZ"
>CREATE CURSOR ( cMylias ) ( Name C(30) )
>
>SELECT (cMyAlias)
>APPEND BLANK
>REPLACE &cMyAlias->Name with "Fred"  && This works ok
>
>
>Must one use macro substition with "->" notation to do this?
>
>Thanks

Name expression would do:
replace (cMyAlias+'.Name') with ...

Update: Gergory and Tore reminded you even don't need alias there:)
One step further:

insert into (m.cMyAlias) (Name) values ("Fred")

Would replace < bg >

SELECT (cMyAlias)
APPEND BLANK
REPLACE &cMyAlias->Name with "Fred" && This works ok

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform