forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help with PATHS PLEASE !

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Fri Mar 01, 2002 3:03 pm    Post subject: Help with PATHS PLEASE ! Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1562

PostPosted: Fri Mar 01, 2002 3:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri Mar 01, 2002 6:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Sat Mar 02, 2002 9:37 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group