Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening table with macro substitution for alias
Message
From
24/01/2006 06:36:02
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01089665
Message ID:
01089675
Views:
15
>I am trying to open a table up a number of times dependant on how many records are in a table named vwmactionnot. The problem is it is not substituting the alias name for lncount. Any ideas waht I am doing wrong?
>
>
>lncount = 1
>DO WHILE vwmactionnot.actionno = 1
>	USE vwmmembership IN 0 ALIAS &lncount again
>	SELECT lncount
>	SET ORDER TO username
>	BROWSE NOINIT nowait
>	lncount = lncount + 1
>	SKIP
>ENDDO
>
Neil,
1) You're trying macro substitute a numeric.
2) Even if that worked alias name should be string and not a numeric
3) Even if you passed that step "select lncount" line woudl always look for an alias named 'lncount'

Suppose you wanted to have aliases like "_1", "_2", "_3" ... instead.
lncount = 1
scan WHILE vwmactionnot.actionno = 1
	USE vwmmembership IN 0 ALIAS ("_"+ltrim(str(m.lncount))) again order tag username
	SELECT ("_"+ltrim(str(m.lncount)))
	BROWSE NOINIT nowait
	lncount = m.lncount + 1
endscan
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
Reply
Map
View

Click here to load this message in the networking platform