>On one project on which I am working on a client, certain errors occured only when the EXE and data files was copied to a separate folder, so that's what I did. For debugging, I ran the EXE from the IDE - fortunately, the error still appeared.
>
>Now, to the error that stumps me. In a certain part of the program, I get a "alias name is already in use" error. The line that causes the error turns out to be something like this:
>
>
>set classlib to SomeClassLibrary additive
>
>
>Since I suspected that the IDE may be showing me the wrong line number - since this has already happened to me before - I try giving the command from the Command Window - same error message. On the suspicion that the classlib is not found, I invent a non-existent classlib:
>
>
>set classlib to abcde additive
>
>
>But I get a different error message, basically, file not found - so that is not the cause.
>
>Now, why would a "set classlib" produce an "alias name is already in use" error? I thought Visual FoxPro would simply add the classlib to the list of classlibs, if it wasn't in the list already. Nor does set("path") point to any folders that might contain additional copies.
>
>I suspected there may be two classlibs with the same name in different folders, but the project only lists one of each.
>
>What else might I check for?
>
>TIA,
>
>Hilmar.
Hilmar,
Classlibs are tables and are aliased when opened. Aliases work as handles. It wouldn't cause alias in use error if the same alias is in use as a table alias.
AFAIK the only way to get that error is by trying to open a class library with the "same name" but "from 2 different folders". ie:
set classlib to SomeClassLibrary additive
set default to SomeOtherFolder
set classlib to SomeClassLibrary additive
IOW I would hunt for lines that change the default path and search paths. You can prevent the error by explicitly including the fullpath of the classlib. I tend not to use set classlib but newobject().
Cetin