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:[email protected]] On Behalf Of Man-wai Chang
Sent: 27 January 2016 13:56
To: ProFox Email List <[email protected]>
Cc: [email protected]
Subject: Re: Alias()

On Wed, Jan 27, 2016 at 5:35 AM, Sytze de Boer <[email protected]> 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]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to