Page 1 of 1 1
Topic Options
#110625 - 2003-12-19 03:18 PM @Scriptdir returning weird results
MadPAM Offline
Lurker

Registered: 2003-11-05
Posts: 4
at least that's what I think...here is the story.

I am using Kix 3.63 on W2K SP4 and would like to find the drive letter and dir that the script was run from (I am building a CD which could be mounted in any drive).

For all examples: the test.kix is in c:\loginscript

When the test script is in the same dir that I am currently in by using "kix32 test.kix" the result for @Scriptdir is "".

When running it from the root of the drive by using "kix32 loginscript\test.kix" @scriptdir returns "loginscript".

If I leave the current dir of drive C: in loginscript and start the script from drive d: by using "kix32 c:test.kix" I get "c:" as a result.

Apparently @scriptdir returns only what was in front of the script name when it was called and not the actual drive/dir it is in. So my question is...how do I find this information???

Thanks!

Top
#110626 - 2003-12-19 03:35 PM Re: @Scriptdir returning weird results
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well... if you are providing the script on a CD, then you have to know what dir it is in! I mean, the CD is read-only... users can't change it!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110627 - 2003-12-19 03:39 PM Re: @Scriptdir returning weird results
MadPAM Offline
Lurker

Registered: 2003-11-05
Posts: 4
there is the possibility that it is copied to harddrive/share/USB stick and run from there. So I want to be on the safe side.

But I still need the drive letter, right?

Top
#110628 - 2003-12-19 03:49 PM Re: @Scriptdir returning weird results
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Can you upgrade to version 4.2x?

I've just done a couple of tests and @SCRIPTDIR always returns the full path with 4.21 (on XP).

If you have @CURDIR you can construct the path, but you'd be better off with the newer version of KiXtart.

Top
#110629 - 2003-12-19 03:50 PM Re: @Scriptdir returning weird results
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If you were to use KiX4.x you would have more options. 3.63 is is very old. If @ScriptDir returns nothing then that means it was run from @CurDir, so then use @CurDir as a second check.

{hmmm.. beat out by Richard)


Edited by Les (2003-12-19 03:51 PM)
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110630 - 2003-12-19 04:38 PM Re: @Scriptdir returning weird results
MadPAM Offline
Lurker

Registered: 2003-11-05
Posts: 4
using 4.22 fixes the issue...but shouldn't 3.63 do the same???
Top
#110631 - 2003-12-19 04:44 PM Re: @Scriptdir returning weird results
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
How can you expect improvements in the 4.22 version to change the past version? We have been trying hard to beat this space/time thingy but still have a few bugs to work out.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110632 - 2003-12-19 04:54 PM Re: @Scriptdir returning weird results
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Hah! Mad by name, certifiable by nature

You will appreciate that a lot has changed between versions 3.63 and 4.22. There are many new features, and some existing facilities will have been improved.

There may even have been some bug fixes.

For example, way back in version 4.00 RC1:
Quote:

Fixed @SCRIPTDIR in UDF's and in Execute().




You may view the change to @SCRIPTDIR as either an enhancement or a bug-fix.

Top
#110633 - 2003-12-19 05:35 PM Re: @Scriptdir returning weird results
MadPAM Offline
Lurker

Registered: 2003-11-05
Posts: 4
I'll take the bugfix then... ;-)

I am just a little surprised that such a "bug" would go unnoticed...

Top
#110634 - 2003-12-19 05:40 PM Re: @Scriptdir returning weird results
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
First off, I would not call it a bug, but rather a feature and what makes you think it has gone unnoticed?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.06 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org