OpenFileRequester

Just starting out? Need help? Post your questions and find answers here.
Switchblade
User
User
Posts: 17
Joined: Mon Apr 05, 2004 1:27 am
Contact:

OpenFileRequester

Post by Switchblade »

hi,

ive got a problem with the OpenFileRequester.

ive made a gui for one of my command line tools.
command line tool Parameters

tool C:\Documents and Settings\Static.txt 50

And here is my problem : Documents and settings ! how can i tell the OpenFileRequester to show that paths DOS like. Course the blank fields between documents and settings are a problem.

thx
AMD 2800+ , 1024DDR 400, Nvidia FX 5600 Pro 256DDR, Hersules Game Theater 7.1
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

The problem lies within ProgramParameters. Every commandline-option is divided by one or more trailing spaces. To make sure, an option is considered as whole, you have to encapsulate it in "

Ex.:
tool "this is my path"
Switchblade
User
User
Posts: 17
Joined: Mon Apr 05, 2004 1:27 am
Contact:

Post by Switchblade »

Its already done ;) with + Chr(34)
AMD 2800+ , 1024DDR 400, Nvidia FX 5600 Pro 256DDR, Hersules Game Theater 7.1
Henrik
Enthusiast
Enthusiast
Posts: 404
Joined: Sat Apr 26, 2003 5:08 pm
Location: Denmark

Post by Henrik »

Hi
You are probably doing somthing wrong when you use chr(34)
you could pass it as a string and debug it to see if it's right

A modified ver from the help

Does this work for you ?

Code: Select all

StandardFile$ = "C:\Documents and Settings\Static.txt 50" ; set initial file+path to display

; With next string we will set the search patterns ("|" as separator) for file displaying:
; 1st: "Text (*.txt)" as name, ".txt" and ".bat" as allowed extension
; 2nd: "PureBasic (*.pb)" as name, ".pb" as allowed extension
; 3rd: "All files (*.*) as name, "*.*" as allowed extension, valid for all files

Pattern$ = "Text (*.txt)|*.txt;*.bat|PureBasic (*.pb)|*.pb|All files (*.*)|*.*" 
Pattern = 0
; use the first of the three possible patterns as standard

File$ = OpenFileRequester("Please choose file to load", StandardFile$, Pattern$, Pattern)
If File$ 
MessageRequester("Information", "You have selected following file:"+Chr(10)+File$, 0)
Else
    MessageRequester("Information", "The requester was canceled.", 0)
EndIf
Best Regards
Henrik
Switchblade
User
User
Posts: 17
Joined: Mon Apr 05, 2004 1:27 am
Contact:

Post by Switchblade »

You are probably doing somthing wrong when you use chr(34)
No, its working fine, couse ive got some commandline tools to use , and ive only made a gui which creates a bat file there the commands are listed in with the parameters and it runs fine ;)

-----------
ok its a primitive way but ive got some problems with a included programm to use it with runprogram (and with the right parameters)
AMD 2800+ , 1024DDR 400, Nvidia FX 5600 Pro 256DDR, Hersules Game Theater 7.1
Post Reply