OPENUP and file dialog box

Discussions specifically related to the Android and iOS editions of BBCSDL
atom058
Posts: 25
Joined: Tue 05 Nov 2019, 18:07

OPENUP and file dialog box

Post by atom058 »

Hello (again)... In the BBCwin manual, it says for OPENUP: "If the supplied filename contains a wildcard (? or *) character anywhere, an Open File dialogue box is displayed."

I can't seem to get that to work...
My filename is "C:\Users\Jeff\Desktop\bbcsdl20\My Programs\*.csv" , which clearly meets the "*" criteria.

My code is:
DataPath$ = @dir$+"*.csv" (which equates to "C:\Users\Jeff\Desktop\bbcsdl20\My Programs\*.csv")
file% = OPENUP(DataPath$)

I don't get any error, it just doesn't do anything.

I am hoping that a File Dialog Box would open that would list all of the .csv files in that directory. Is this only for BBCWin? Am I doing something wrong? Will this work on the Android version (final destination)?
RichardRussell

Re: OPENUP and file dialog box

Post by RichardRussell »

atom058 wrote: Thu 09 Apr 2020, 22:18 In the BBCwin manual, it says for OPENUP: "If the supplied filename contains a wildcard (? or *) character anywhere, an Open File dialogue box is displayed."
Indeed it does, but you are not using BBC BASIC for Windows and in the differences document it says this (in section 3f): "BBCSDL does not display a file selector if an attempt is made to open a file with a name containing wildcard characters". I would recommend familiarising yourself with the ways in which BB4W and BBCSDL differ.
I am hoping that a File Dialog Box would open that would list all of the .csv files in that directory.
You are hoping in vain! BB4W can do this because displaying a file dialogue is a simple case of calling the GetOpenFileName Windows API function. SDL2 (the Simple DirectMedia Layer version 2.0) provides no such API, or anything similar. I referred to this issue in my earlier reply, and my comments there still stand.
atom058
Posts: 25
Joined: Tue 05 Nov 2019, 18:07

Re: OPENUP and file dialog box

Post by atom058 »

Richard - Thank you for pointing me to that document - I have read it and see that this had the answers to several of my questions. Thank you for your patient replies. This is a new experience for me and the amount of information out there is a little overwhelming. As I become more comfortable with this, I'm sure I will be able to find (most of) my own answers. Thanks again.