dialog.openfile to message
Posted
#1
(In Topic #1353)
Regular

.Dim opensf As String
opensf = Dialog.OpenFile()
Message(opensf)
I know it's probably something simple but i can't seem to wrap my head around it..
Anyone?
Posted
Regular

If Dialog.OpenFile() Then
Message.Info("Selected file: " & Dialog.Path)
Else
Message.Info("Nothing selected")
Endif
But I jujst keep getting the Nothing Selected error.
Posted
Regular

Dim myresult As String
myresult = Dialog.OpenFile()
Message(Dialog.Path)
Posted
Guru

Read this Gambas One - Gambas ONE
I explained Dialog commands return an error value , not a filename and not True if all is okay.
Dialog.OpenFile() is no different to Dialog.SaveFile()
So
Dialog.OpenFile() returns True if cancelled or False if selected.
So your code is the wrong way round.
It should be like this
Posted
Guru

/comp/gb.qt4/dialog/openfile - Gambas Documentation
How to use Dialog.OpenFile properly is all very clear there. Examples and all
If as you say "you aspire to be like me" with gambas coding then you really need to use and study the gambas wiki more.
That's how i learned all the simple stuff.
Posted
Guru

Posted
Regular

Posted
Guru

I asked because the problems you were having here with your first examples are all explained in that other post.
I'm just not sure how you had these issues unless you had not read the other posts replies where it was explained.
To answer this post i've just had to repeat what i said in that one.
1 guest and 0 members have just viewed this.



