Source language: Translate to:

Replace Path

General questions about NeoBook

Moderator: Neosoft Support

Replace Path

Postby StarterPack » Sat Apr 09, 2016 3:57 am

Hi Guys, When I build my program i used a path (example) !C:\My Program.... etc to read and write files, because i've tested it everytime.
Now i want to compile the program. How do i replace all my paths with [SrchDir]
Thank You
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Replace Path

Postby Gaev » Sat Apr 09, 2016 5:29 am

StarterPack:

Instead of using absolute path references, you can use relative path references ... from the Help file ...

[PubDir] The folder where the publication EXE resides.

... so you can code something like ...
Code: Select all
FileRead "![PubDir]somefile.dat" "All" "[someVariable]"
or
FileRead "![PubDir]someSubFolder\somefile.dat" "All" "[someVariable]"


This way, you never have to change file references ... just make sure the data files are located in the same relative position to the pub/exe file.
User avatar
Gaev
 
Posts: 3737
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Replace Path

Postby StarterPack » Sat Apr 09, 2016 6:25 am

Hi Gaev

So I guess there's no other way but to enter all my paths manually? Thanks for the advice.
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Replace Path

Postby Cipolla » Sat Apr 09, 2016 7:03 am

There is still another way ;)

1. Please make a backup of your pub file.
2. Open your pub file in windows editor
3. do a ctrl+h to find & replace text
4. simply replace all absolute path references (i.e. "!C:\My Program...." with [SrchDir] or [PubDir] like GAEV mentioned
5. save all and reopen in Neobook
Greetings from Germany
Klaus
User avatar
Cipolla
 
Posts: 166
Joined: Fri Apr 01, 2005 1:45 am
Location: Germany

Re: Replace Path

Postby StarterPack » Sun Apr 10, 2016 1:43 am

Hi Cipolla

Thank You!!! This will save me lots of time
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest