Problem with Filerequester

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Enthusiast
Enthusiast
Posts: 549
Joined: Tue Oct 14, 2014 12:09 pm

Problem with Filerequester

Post 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)
User avatar
TI-994A
Addict
Addict
Posts: 2728
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Problem with Filerequester

Post 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)
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
minimy
Enthusiast
Enthusiast
Posts: 596
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Problem with Filerequester

Post 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)
If translation=Error: reply="Sorry, Im Spanish": Endif
User avatar
minimy
Enthusiast
Enthusiast
Posts: 596
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: Problem with Filerequester

Post by minimy »

LOL you win me TI-994A :lol:
If translation=Error: reply="Sorry, Im Spanish": Endif
User avatar
TI-994A
Addict
Addict
Posts: 2728
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Problem with Filerequester

Post by TI-994A »

minimy wrote: Fri Aug 15, 2025 7:16 pm LOL you win me TI-994A :lol:

Just happened to be online! :lol:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
loulou2522
Enthusiast
Enthusiast
Posts: 549
Joined: Tue Oct 14, 2014 12:09 pm

Re: Problem with Filerequester

Post by loulou2522 »

desolated , but i modify my programm replace quote with double quote but that' dont work
infratec
Always Here
Always Here
Posts: 7598
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Problem with Filerequester

Post by infratec »

Your code with DQOUTES works here:
PB 6.21 x86 asm backend on windows 10 x64

What is your environment?
loulou2522
Enthusiast
Enthusiast
Posts: 549
Joined: Tue Oct 14, 2014 12:09 pm

Re: Problem with Filerequester

Post 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)
User avatar
TI-994A
Addict
Addict
Posts: 2728
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Problem with Filerequester

Post 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.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
Demivec
Addict
Addict
Posts: 4265
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Problem with Filerequester

Post 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.
User avatar
TI-994A
Addict
Addict
Posts: 2728
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Problem with Filerequester

Post 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.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
BarryG
Addict
Addict
Posts: 4160
Joined: Thu Apr 18, 2019 8:17 am

Re: Problem with Filerequester

Post by BarryG »

loulou2522 wrote: Fri Aug 15, 2025 7:22 pmi modify my programm replace quote with double quote but that' dont work

Code: Select all

DefaultFile$ = “d:\toto\toto.csv”
They're not the double quotes used by PureBasic. They're curly quotes. Compare with what's needed:

Code: Select all

DefaultFile$ = "d:\toto\toto.csv"
Olli
Addict
Addict
Posts: 1222
Joined: Wed May 27, 2020 12:26 pm

Re: Problem with Filerequester

Post by Olli »

Humour ?
User avatar
Kiffi
Addict
Addict
Posts: 1492
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Problem with Filerequester

Post by Kiffi »

Olli wrote: Mon Aug 18, 2025 7:14 amHumour ?
Glasses broken?
Hygge
User avatar
Lord
Addict
Addict
Posts: 902
Joined: Tue May 26, 2009 2:11 pm

Re: Problem with Filerequester

Post by Lord »

$93 versus $22
Image
Post Reply