Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating "Temporary alias" problem. 1

Status
Not open for further replies.

delphiman

Programmer
Dec 13, 2001
422
ZA

I am trying to create a temporary alias and am using the following code - which
I got somewhere (??) ages ago.

Firstly I got an exception to the word "Session" so I installed a Session component.
Which seemed to remove the exception. But then I got an exception to using the words
"Screen" and "crHourglass" as being "UnDeclared identifier".

Can someone throw some light on this please?


procedure TdmFamily.DataModuleCreate(Sender: TObject);
var
strAliasName, // name for the temporary alias
strAliasPath : string; // directory the alias points to
begin
strAliasName := 'Family';
strAliasPath := 'c:\h\Lectures\Day13\Tables';
with Session do
try
screen.cursor := crHourglass;
if not isAlias( strAliasName ) then
addStandardAlias( strAliasName, strAliasPath, 'Paradox' );
finally
screen.cursor := crDefault
end;
end;
 
A datamodule is a container for non visual components so it would not make any sense to change the look of the cursor. It would be another thing is you created a splashscreen with a progress indicator while creating the datamodule. The splashscreen (or form) would be able to modify the cursor visual.

Check out (Beginner to Delphi 7) Working The Basics?
thread102-538656 maybe it is of some use.

Best regards

Steven van Els
SAvanEls@cq-link.sr
 
"Screen" and "crHourglass" as being "UnDeclared identifier".

I think you mean you received a compiler error, not an exception.

Just include the unit "Forms" in the implimentation section and I think it will be fine.


Cheers
 
Every visual component has the property cursor. The non visual components like table, query, dataset, tmainmenu, tpopupmenu don't have it.
crHourGlass is not a variable, it is a value of the variable cursor

Steven van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top