Source language: Translate to:

list files contained in a folder?

General questions about NeoBook

Moderator: Neosoft Support

list files contained in a folder?

Postby yanzco » Fri Sep 05, 2014 8:46 am

i was wondering..
how can i make neobook view files and its filenames that is contained in a specific folder?..

ex.
foldername: notes
files inside foldername notes are

09-1-14.txt
09-2-14.txt
09-3-14.txt
09-4-14.txt
09-5-14.txt
09-6-14.txt

i wanted neobook to display the filenames that is contained in that folder..
and also store it's filename and path to variables..

ex.
which notes do you want to view?
09-1-14
09-2-14
...
...etc


i was trying to do it that when when a date is clicked.. it opens the file corresponding to that date..
yanzco
 
Posts: 178
Joined: Sun Jul 20, 2014 4:07 am

Re: list files contained in a folder?

Postby Gaev » Fri Sep 05, 2014 9:07 am

yanzco:

This command ...
Code: Select all
FileList "![PubDir]notes\*.txt" "Files+NoExt" "[NotesFilesList]"

... will place the list of files (without the Extensions) in the variable named [NotesFilesList] ... separated by a carriage return character.

So, if you have a ListBox whose ...

- List Items property set to [NotesFilesList]
- Variable: (to store selected item) set to [SelectedItem]

... then, the user can select the date item from this widget ... in the Selection Changed event handler, you can recreate the full file path+name+extension like so ...
Code: Select all
SetVar "[SelectedFile]" "![PubDir]notes\[SelectedItem].txt

... then display the file ...

- either in a TextEntry Field Tool (style = multi-line)
- or using the Run command with notepad.exe
Last edited by Gaev on Fri Sep 05, 2014 4:12 pm, edited 1 time in total.
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: list files contained in a folder?

Postby yanzco » Fri Sep 05, 2014 2:52 pm

got it.. worked perfectly.. :D thanks gaev :P
yanzco
 
Posts: 178
Joined: Sun Jul 20, 2014 4:07 am


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest