[Gambas-user] Problem with Exist & Open functions with filename containing spaces

John Rose john.aaron.rose at ...626...
Thu Mar 12 12:22:57 CET 2015


On 12/03/15 10:37, Tobias Boege wrote:
> Public Sub Main()
>   Dim sPath As String = Temp$("with spaces")
>   Dim hFile As Stream
>   Dim sLine As String
>
>   File.Save(sPath, "some string")
>
>   Debug "Path =";; sPath
>   Debug "Exist =";; Exist(sPath)
>   Debug "Content ="
>   hFile = Open sPath For Input
>   For Each sLine In hFile.Lines
>     Debug "  "; sLine
>   Next
>   Close #hFile
> End
I've tried that program and it didn't display anything in the Console
window. I was not able to compile the attached Test app with Debug as
when I tried to add the gb.debug component (by clicking its checkbox
which did put an x in it) using Project Properties, it did not enable
the OK button. When I closed the Project Properties window & reopened
it, the checkbox was not marked with an x. So I put in Print statements
and it did not even show their results on the Console window when I ran
the Test app. BTW I think that the 'File or Directory does not exist'
window appears because I have a 'Catch' followed by
'Message.Warning(ERROR.Text)' in the coding of the relevant Sub. Is it
possible to show the line number when the Catch 'catches'? I've also
tried putting Breakpoints in my app but that didn't help.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test.tar.gz
Type: application/gzip
Size: 9093 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150312/71fddd81/attachment.gz>


More information about the User mailing list