Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set classlib - and alias in use?
Message
De
15/10/2008 05:14:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/10/2008 21:18:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01355033
Message ID:
01355066
Vues:
25
>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 && now another SomeClassLibrary is in search path

set classlib to SomeClassLibrary additive && this one would error
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform