The Daily Click ::. Forums ::. Klik Coding Help ::. Simple File Browser in TGF
 

Post Reply  Post Oekaki 
 

Posted By Message

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
19th August, 2006 at 17:58:54 -

This has been bothering the hell out of me as of late. I've been using two list boxes. One to load up a directory list, and the other to load a files list.

The directory list contains brackets before and after each folder name and won't allow me to open new directories automatically.

I've zipped an example with the Browser2 and File extensions. I'm not asking anyone to fix it for me and send it back. I just think this might help someone in suggesting a solve to my dilema.


I'm thinking I should use the String Parser 2 extension, but I haven't the first clue on HOW to use it to remove the brackets and pass the folder path back into the directory list box.

http://home.comcast.net/~jdkolibaba/dwnlds/filebrowser.zip

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
20th August, 2006 at 07:09:44 -

I don't think I explained this well enough.
Here's the problem I'm running into:

The Directory Listbox displays directories like this:
[..]
[PROGRAM FILES]
[WINDOWS]

I can get the file list from the initial directory by loading a file list with the command here:
appdrive$ + appdir$ + "*.*"

and I have it set up so in "theory", when I double-click a directory in the Directory Listbox, both the Directory Listbox and the File Listbox refresh themselves. The Directory Listbox is supposed to display any folders from within the newly selected file path, and the File Listbox is supposed to show any files contained within the newly selected file path.

Unfortunately both the Directory Listbox AND the File Listbox go blank because TGF includes the brackets in the directory path when a new directory is selected.

Instead of navigating to "c:\WINDOWS" for instance , TGF will try to navigate to "c:\[WINDOWS]". With the brackets included, "c:\[WINDOWS]" obviously isn't a valid directory.

I'm just trying to find a way to remove those damn brackets. I suppose String Parser 2 will work, but I don't have the foggiest clue on how to use the damn thing. Any help?

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

Werbad



Registered
  18/09/2002
Points
  235
20th August, 2006 at 07:25:50 -

There is a function for getting directory names from Lists, alteast in MMF but it should be in TGF also
Instead of List Select$( "List" ) or whatever it is, use List SelDir$( "List" )
In the expression editor it says Get current line (Directory)
There is the same thing for drives too


 
n/a

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
20th August, 2006 at 08:27:37 -

You ever have those moments where you smack yourself in the forehead for overlooking something that should have been easily noticable? Well, this is one of those moments for me. Thank you, thank you, thank you! You've been a real help.

-Grim

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
20th August, 2006 at 12:07:02 -

In MMF you could have used the Mid$ function, but you'll have to use String Parser in TGF. I only have String Parser 2, but if SP1 is anything like SP2, it should go like this:

(Let's assume you store the current path in a string called "path")

Start of level
-String Parser: Add delimeter "["
-String Parser: Add delimeter "]"

(List item clicked)
-String Parser: Set source string to List Select$( "List" )
-"path": Set alterable string to listGetAt$( "String Parser 2", 1 )

Image Edited by the Author.

 
n/a

Werbad



Registered
  18/09/2002
Points
  235
21st August, 2006 at 03:00:30 -

Since he uses a list object he doesn't need to parse it since, as i said, there is built in functions in the list object

 
n/a

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
23rd August, 2006 at 00:48:44 -

Thanks, Axel. Since I really had no idea how to use String Parser, your post provides a quick, understandable run down, but Werbad is right. I didn't really need it (thankfully). Thanks to you two, the file browser is close to complete. I'd insist on putting your names in the credits, but I'm throwing together some pirated warez compilations, and I doubt either of you two want your handles floating around the net on a peice of software like this.

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
23rd August, 2006 at 00:49:46 -

If I ever find any legal use for a file browser, though, your names will go in the credits. Thanks a million.

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
23rd August, 2006 at 14:01:54 -

Darn it, I got the same thing when I was making Easy Site Editor 1! Thanks a bunch for this!

 
Old member (~2004-2007).
   

Post Reply



 



Advertisement

Worth A Click