View previous topic :: View next topic |
Author |
Message |
Rubes_sw Valued Contributor
Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Fri Mar 01, 2002 3:03 pm Post subject: Help with PATHS PLEASE ! |
|
|
I am the author of PC Protector (that does not work at the minute).
My program starts once the machine is started or if you log off and log back on but I cant get it to do the path.
REM START OF SCRIPT
%%curd = @curdir()
%%rscfile = %%cur\PCProtector.dsr
title PC Protector
gosub checkfiles
external %%curd\vdssplash.dll
external %%curd\vdswinver.dll
external %%curd\vdsprot.dll
I tried the above but it did not work.
So I tried:
%%curd = @curdir()
INFO %%curd
exit
%%rscfile = %%cur\PCProtector.dsr
title PC Protector
gosub checkfiles
external %%curd\vdssplash.dll
external %%curd\vdswinver.dll
external %%curd\vdsprot.dll
This returned:
INFo C:\windows
How???, I need help please
Nathan |
|
Back to top |
|
|
PGWARE Web Host
Joined: 29 Dec 2001 Posts: 1562
|
Posted: Fri Mar 01, 2002 3:56 pm Post subject: |
|
|
You shouldn't use CURDIR, that function returns the current directory globally selected in Windows, this can be any directory practicaly that is currently selected as the Windows global CURDIR. Use %0 variable, it holds the filepath and exename of your exe >
@path(%0) will return the real path of your exe file. |
|
Back to top |
|
|
SnarlingSheep Professional Member
Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Mar 01, 2002 6:04 pm Post subject: |
|
|
Code: |
REM START OF SCRIPT
%%curd = @curdir()
REM %%cur should be %%curd right?
%%rscfile = %%cur\PCProtector.dsr
|
I believe you forgot the d in %%curd in your %%rscfile variable.
I think one of the best things you can do when you start to write program is to remember that it will be used by people with different Systems.
Code: |
REM Path of your VDS Program(used when ran from the editor it returns the path to your source file, but after compiling returns your program's path)
info @PATH(%0)
REM Windows Directory
info @WINDIR()
REM Windows System Directory
info @WINDIR(S)
REM Windows Temp Directory
info @WINDIR(T)
|
Good luck. _________________ -Sheep
My pockets hurt... |
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Sat Mar 02, 2002 9:37 am Post subject: |
|
|
I absolutely agree with Sheep on this one - hardcode as few paths etc. in
your programs as possible because users have their files in very different
locations, depending on OS, individual setup etc.
You should also be aware of a couple of things when handling path output
from VDS: For some reason (bug?) @windir(T), returns a path with a
trailing backslash (for example C:\Windows\Temp\ ). Root dirs (D:\ or
F:\ ) also have a trailing backslash - all other path output does not.
So it would also be wise to homogenize your path string by passing paths
through a little routine, like this:
Code: |
REM put your path string into this variable
%X = @windir(T)
REM Kill backslash, if any
%L = @LEN(%X)
if @EQUAL(@SUBSTR(%X,%L,),\)
%X = @STRDEL(%X,%L,)
end
|
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
|