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