BBC BASIC for Windows
« Selecting a file name from Browse »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:44pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Selecting a file name from Browse  (Read 403 times)
Danny72
New Member
Image


member is offline

Avatar




PM


Posts: 20
xx Selecting a file name from Browse
« Thread started on: Jan 7th, 2010, 3:52pm »

Hello

I would like to know if there is a way for the user to select a file from browsing folders, and for the filename and path to be stored in a string (perhaps if that is suitable). Many thanks.
Danny

I found the Browse folder code at http://www.bbcbasic.co.uk/bbcwin/manual/bbcwine.html#opensave



dim bi{hOwner%, pidlRoot%, pszDisplayName%, \
\ lpszTitle%, ulFlags%, lpfn%, lParam%, iImage%}
dim folder{t&(260)}
titlez$ = title$+chr$0
bi.hOwner% = @hwnd%
bi.pszDisplayName% = folder{}
bi.lpszTitle% = !^titlez$

sys "SHBrowseForFolder", bi{} to pidl%
if pidl% sys "SHGetPathFromIDList", pidl%, folder{}
folder$ = $$folder{}
sys "SHGetMalloc", ^malloc%
sys !(!malloc%+20), malloc%, pidl% : rem. IMalloc::Free
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Selecting a file name from Browse
« Reply #1 on: Jan 7th, 2010, 4:13pm »

Quote:
I would like to know if there is a way for the user to select a file from browsing folders

Browsing for folders (using SHBrowseForFolder) is, as the name suggests, only for selecting a folder (directory). If you want to select a file (or group of files) then use GetOpenFileName (or GetSaveFileName), which are documented in the same place:

http://www.bbcbasic.co.uk/bbcwin/manual/bbcwine.html#opensave

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls