Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select with a variable
Message
 
 
To
27/10/2000 10:58:38
Gad Hutt
Express Print
Herzliya, Israel
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00434921
Message ID:
00435195
Views:
13
Gadi,

I've just tried:
lTable='BldMstr'
use (lTable) alias (lTable) again shared in 0

it works fine.

Close VFP. Open it again. cd to directory with any table.
lTable='YourTable' && Any name of existing table
use (lTable) alias (lTable) again shared in 0

If it would not work, I don't have other suggestions. Is it a problem in local version of VFP? I don't believe it. You don't use Hebrew in Table names, I hope :)

>>
>>Hi Gadi,
>>
>>First of all for simplicity try this:
>>
>> if used ('JobSheet') && This alias is already in use
>>    select JobSheet
>> else
>>    use JobSheet again shared alias JobSheet in 0 && This would open JobSheet table in shared mode, we didn't try to check for possible errors here
>>   select JobSheet
>> endif
>>
>>Second test:
>>
>> lTableName='JobSheet'
>> if used(lTableName)
>>    select (lTableName)
>> else
>>   use (lTableName) alias (lTableName) again shared in 0
>>   select (lTableName)
>>  endif
>>
>>
>> Third test:
>>
>> TableName is a field in Table called AllTables
>> lTableName=evaluate('AllTables.TableName') && Get the field content
>>  if used(lTableName)
>>    select (lTableName)
>> else
>>   use (lTableName) alias (lTableName) again shared in 0
>>   select (lTableName)
>>  endif
>>
>>
>>Hopefully, it makes this clear for you.
>
>Hi Nadia,
>I guess it's not my day...
>Now I wrote your code and I get a syntax error on the line: use(..) alias(..) again shared in 0 ....
>
>I feel so stupid. :-(
>Never mind I can write the code with no variables, it will be less dynamic, but at least it will work ...
>
>Many Thanks,
>Gadi
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform