I agree with Man-Wai as well. Always use use use <file> again in select(0) to ensure you are selecting a file area that is not in use.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Man-wai Chang Sent: 27 January 2016 13:56 To: ProFox Email List profox@leafe.com Cc: profoxtech@leafe.com Subject: Re: Alias()
On Wed, Jan 27, 2016 at 5:35 AM, Sytze de Boer sytze.kiss@gmail.com wrote:
sele 909 use (ltable) alias Junk1 Excl If I issue wait window alias(), it returns Junk1 If I use (ltable) alias "Junk1" Excl, it returns Junk1 as well Is this normal?
I don't use quotes when specifying an alias
I ask because I have a client who consistently ends up with an error variable code not found
If the table could not be opened, then table.code would not be accessible!
So my suggestions:
1. "select 0" is better than "select 909"! 2. Use used() to check whether the table was opened 3. Because you are trying to open a table EXCL, you should set ON ERROR! Better, use TRY... CATCH if you are using VFP 9.
LOCAL m.errhand
m.errhand=ON("ERROR") ON ERROR * SELECT 0 USE (lTable) EXCLUSIVE ALIAS junk1 ON ERROR &errhand IF USED() * * do your stuff * REPLACE junk1.code WITH ..... USE ENDIF
-- .~. Might, Courage, Vision. SINCERITY! / v \ 64-bit Ubuntu 9.10 (Linux kernel 2.6.39.3) /( _ )\ http://sites.google.com/site/changmw ^ ^ May the Force and farces be with you!
[excessive quoting removed by server]