>Hello All,
>I've come across some unusual behavior in VFP6 and if anyone has an explanation it sure would help!
>I'm receiving excel spreadsheets that I'm changing into dbfs and cleaning them up, etc. for reporting purposes. I don't want to rename them for obvious reasons but a lot of them have dashes in their names. sheet-1 ofr instance.
>I am able to create the table sheet-1 with the command
>"CREATE TABLE sheet-1 FREE FROM ARRAY myarry"
>but when I open the data session window I find that the table
>sheet_1 is open. I cannot select sheet-1 or close sheet-1 whereas I can do both with shet_1.
>
>Why is VFP6 renaming the table alias??
>
Because the '-' is seen as an operator by the VFP parser, VFP changes the character in the alias to protect you from ambiguous expression. If the - were used in the alias, the string Sheet-1 could be either a numeric expression or an alias name.
VFP will convert the operator to the underscore to avoid confusion. The same thing would happen if you used the table name SHEET+1.DBF, a legal file name that would result in an ambiguous reference for VFP's parser.
>Thanks
>
>Sandy