Source language: Translate to:

Read Folder Path On Run

General questions about NeoBook

Moderator: Neosoft Support

Read Folder Path On Run

Postby StarterPack » Mon Apr 24, 2017 12:04 am

Hi guys...
What script can I use to read a Folder's path when i start my app

Thank You
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Read Folder Path On Run

Postby Gaev » Mon Apr 24, 2017 6:13 am

StarterPack:

Folder's path when i start my app

What (in your mind) is the difference between a Folder (name) and its Path ? ... please explain with an example.

Or were you looking for the Path of the Application ? ([PubDir]) ... or that of the Windows Temporary Folder ([TempDir]) ?

You can get the path of any file using ExtractFilePath e.g. ...
Code: Select all
ExtractFilePath "c:\a\b\any.file" "[myPath]"

... will return c:\a\b\ in [myPath].

Note that [i]any.file[/b] does NOT have to exist.
User avatar
Gaev
 
Posts: 3728
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Read Folder Path On Run

Postby StarterPack » Mon Apr 24, 2017 2:56 pm

Hi Gaev...

What I was trying to do is.... When I want to do a Reset (Clean All) on my App, it must Delete the Folder that is in my App and everything in it, and then create a new Folder. I can do that with the Call function (Call "Delete Folder.txt" "FolderPath") to delete the Folder and then use CreateFolder "[PubDir]MyFolder to create a clean Folder. But the call function doesn't understand [PubDir]. So I had to read the Folder's full path in a variable [FolderPath] and then tell Call function to delete that Folder. The ExtractFilePath works for me, Thank You. But when I use script on startup of my app (ExtractFilePath "[PubDir]MyFolder\" "[FolderPath]") then the call function doesn't find the path with the \ (backslash) in the end. How can I remove the last letter or in this case, the \ (backslash) from the variable

Thank You.
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Read Folder Path On Run

Postby StarterPack » Mon Apr 24, 2017 3:08 pm

Hi Gaev... I figured it out. Thank You

I use StrLen and StrDel to delete last letter.
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 2 guests