Page 1 of 2
Problem with Filerequester
Posted: Fri Aug 15, 2025 6:59 pm
by loulou2522
Hello,
I am having a problem with the Filerequester instruction. Here is my code
DefaultFile$ = ‘d:\toto\toto.csv’
; ; Default directory and file to be displayed
Filter$ = ‘CSV file(*.csv)|*.csv’
Filter = 0 ; use the first of the three possible filters by default
File11$ = OpenFileRequester(‘Select file to import’, DefaultFile$, Filter$, Filter)
Despite this, I am unable to set Openfileresquester to the directory ‘d:\toto’ and the file ‘toto.csv’.
Can anyone assist?
Translated with DeepL.com (free version)
Re: Problem with Filerequester
Posted: Fri Aug 15, 2025 7:12 pm
by TI-994A
loulou2522 wrote: Fri Aug 15, 2025 6:59 pm
Hello,
I am having a problem with the Filerequester instruction. Here is my code
DefaultFile$ = ‘d:\toto\toto.csv’
; ; Default directory and file to be displayed
Filter$ = ‘CSV file(*.csv)|*.csv’
Filter = 0 ; use the first of the three possible filters by default
File11$ = OpenFileRequester(‘Select file to import’, DefaultFile$, Filter$, Filter)
Despite this, I am unable to set Openfileresquester to the directory ‘d:\toto’ and the file ‘toto.csv’.
Can anyone assist?
Changed all the string expressions to double-quotes and it works perfectly.
Code: Select all
DefaultFile$ = "d:\toto\toto.csv"
; ; Default directory and file to be displayed
Filter$ = "CSV file(*.csv)|*.csv"
Filter = 0 ; use the first of the three possible filters by default
File11$ = OpenFileRequester("Select file To import", DefaultFile$, Filter$, Filter)
Re: Problem with Filerequester
Posted: Fri Aug 15, 2025 7:15 pm
by minimy
DefaultFile$ = "d:\toto\toto.csv"
; ; Default directory and file to be displayed
Filter$ = "CSV file(*.csv)|*.csv"
Filter = 0 ; use the first of the three possible filters by default
File11$ = OpenFileRequester("Select file To Import", DefaultFile$, Filter$, Filter)
Re: Problem with Filerequester
Posted: Fri Aug 15, 2025 7:16 pm
by minimy
LOL you win me TI-994A

Re: Problem with Filerequester
Posted: Fri Aug 15, 2025 7:18 pm
by TI-994A
minimy wrote: Fri Aug 15, 2025 7:16 pm
LOL you win me TI-994A
Just happened to be online!

Re: Problem with Filerequester
Posted: Fri Aug 15, 2025 7:22 pm
by loulou2522
desolated , but i modify my programm replace quote with double quote but that' dont work
Re: Problem with Filerequester
Posted: Fri Aug 15, 2025 7:29 pm
by infratec
Your code with DQOUTES works here:
PB 6.21 x86 asm backend on windows 10 x64
What is your environment?
Re: Problem with Filerequester
Posted: Sat Aug 16, 2025 5:59 am
by loulou2522
This problem occurs when I call input file requester for the second time
Code: Select all
DefaultFile$ = “d:\toto\toto.csv”
; DefaultFile$ = default file to be displayed
Filter$ = “CSV file (*.csv)|*.csv”
Filter = 0 ; use the first of the three possible filters by default
File11$ = OpenFileRequester(“Select file to import”, DefaultFile$, Filter$, Filter)
The first time I call the function, it goes to the right directory, but when I call the function with other parameters inside the same executable
Code: Select all
DefaultFile$ = “d:\toto1l\toto1.csv”
; DefaultFile$ = default file to be displayed
Filter$ = “CSV file (*.csv)|*.csv”
Filter = 0 ; use the first of the three possible filters by default
File11$ = OpenFileRequester(“Select file to import”, DefaultFile$, Filter$, Filter)
the function repositions itself on the default file of the first inputfilerequester
Translated with DeepL.com (free version)
Re: Problem with Filerequester
Posted: Sat Aug 16, 2025 6:37 am
by TI-994A
loulou2522 wrote: Sat Aug 16, 2025 5:59 am
This problem occurs when I call input file requester for the second time...
the function repositions itself on the default file of the first inputfilerequester
It still works as expected.
Code: Select all
DefaultFile$ = "d:\toto\toto.csv"
Filter$ = "CSV file(*.csv)|*.csv"
Filter = 0
File11$ = OpenFileRequester("Select file to import", DefaultFile$, Filter$, Filter)
DefaultFile$ = "d:\toto1\toto.txt"
Filter$ = "Text file(*.txt)|*.txt"
Filter = 0
File11$ = OpenFileRequester("Select file to import", DefaultFile$, Filter$, Filter)
The only conceivable reason for the requester to fall back to the earlier defaults would be if any of the updated default values are invalid.
For example, if the
d:\toto1 folder did not exist, it would simply reopen the
d:\toto folder.
Re: Problem with Filerequester
Posted: Sat Aug 16, 2025 7:01 am
by Demivec
loulou2522 wrote: Sat Aug 16, 2025 5:59 am
This problem occurs when I call input file requester for the second time
Code: Select all
DefaultFile$ = “d:\toto\toto.csv”
; DefaultFile$ = default file to be displayed
Filter$ = “CSV file (*.csv)|*.csv”
Filter = 0 ; use the first of the three possible filters by default
File11$ = OpenFileRequester(“Select file to import”, DefaultFile$, Filter$, Filter)
The first time I call the function, it goes to the right directory, but when I call the function with other parameters inside the same executable
Code: Select all
DefaultFile$ = “d:\toto1l\toto1.csv”
; DefaultFile$ = default file to be displayed
Filter$ = “CSV file (*.csv)|*.csv”
Filter = 0 ; use the first of the three possible filters by default
File11$ = OpenFileRequester(“Select file to import”, DefaultFile$, Filter$, Filter)
the function repositions itself on the default file of the first inputfilerequester
It is strange and annoying. It is not PureBasic's fault. It is a feature of the Windows OS.
See this forum link: https:
https://www.purebasic.fr/english/viewtopic.php?p=578528.
See this forum thread for some solution ideas to work around it:
https://www.purebasic.fr/english/viewtopic.php?t=73909.
Re: Problem with Filerequester
Posted: Sat Aug 16, 2025 7:32 am
by TI-994A
Demivec wrote: Sat Aug 16, 2025 7:01 amIt is strange and annoying. It is not PureBasic's fault. It is a feature of the Windows OS.
The compiled and IDE versions work perfectly, for both
OpenFileRequester() as well as
SaveFileRequester(), as tested on
Win10 with PB v6.12 x64 and Win11 with PB v6.21 arm64, and also on MacOS Sequoia with PB v6.21 arm64.
Re: Problem with Filerequester
Posted: Sun Aug 17, 2025 3:54 am
by BarryG
loulou2522 wrote: Fri Aug 15, 2025 7:22 pmi modify my programm replace quote with double quote but that' dont work
They're not the double quotes used by PureBasic. They're curly quotes. Compare with what's needed:
Re: Problem with Filerequester
Posted: Mon Aug 18, 2025 7:14 am
by Olli
Humour ?
Re: Problem with Filerequester
Posted: Mon Aug 18, 2025 7:50 am
by Kiffi
Olli wrote: Mon Aug 18, 2025 7:14 amHumour ?
Glasses broken?
Re: Problem with Filerequester
Posted: Mon Aug 18, 2025 8:45 am
by Lord
$93 versus $22