Discussion:
[Gambas-user] Possible bug
Charlie
2013-05-14 16:09:29 UTC
Permalink
Hi all,

You need one *Button* and one *DirChooser* on your form
I have reduced code to the following to emulate this bug I am getting: -
'*********************************************************
Public Sub _new()
End

Public Sub Form_Open()
End


Public Sub Button1_Click()

Dim SDir As String
Sdir = DirChooser1.SelectedPath
SDir = Replace(SDir, " ", "\ ")

End
'*********************************************************

Run the program and it crashes Gambas every time.

Any ideas?

Thanks,

Charlie

[System]
OperatingSystem=Linux
Kernel=3.5.0-17-generic
Architecture=i686
Memory=8182136 kB
DistributionVendor=LinuxMint
DistributionRelease="Linux Mint 14 Nadia"
Desktop=Gnome

[Gambas 3]
Version=3.1.1
Path=/usr/bin/gbx3

[Libraries]
Qt4=libQtCore.so.4.8.3
GTK+=libgtk-x11-2.0.so.0.2400.13




--
View this message in context: http://gambas.8142.n7.nabble.com/Possible-bug-tp41943.html
Sent from the gambas-user mailing list archive at Nabble.com.
Benoît Minisini
2013-05-14 18:38:50 UTC
Permalink
Post by Charlie
Hi all,
You need one *Button* and one *DirChooser* on your form
I have reduced code to the following to emulate this bug I am getting: -
'*********************************************************
Public Sub _new()
End
Public Sub Form_Open()
End
Public Sub Button1_Click()
Dim SDir As String
Sdir = DirChooser1.SelectedPath
SDir = Replace(SDir, " ", "\ ")
This line is not syntactically correct ("\ "). Please provide a project
or at least code that compiles!

Regards,
--
Benoît Minisini
Charlie
2013-05-14 23:17:30 UTC
Permalink
Hi  Benoit,

It may, or may not, be good syntax but press F5 and Gambas crashes. You can not compile it because Gambas crashes.

The purpose of the code was to change "dir" string into a form tha BASH would accept from Shell command if there are spaces in the "dir" string.

I am not an expert in any of this. I am just tring to help by pointing this issue out. If it is a syntax error Gambas should detect this and not crash.

Regards,

Charlie.
Post by Charlie
Hi all,
You need one *Button* and one *DirChooser* on your form
I have reduced code to the following to emulate this bug I am getting: -
'*********************************************************
Public Sub _new()
End
Public Sub Form_Open()
End
Public Sub Button1_Click()
Dim SDir As String
Sdir = DirChooser1.SelectedPath
SDir = Replace(SDir, " ", "\ ")
This line is not syntactically correct ("\ "). Please provide a project
or at least code that compiles!

Regards,
--
Benoît Minisini

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user


If you reply to this email, your message will be added to the discussion below:
http://gambas.8142.n7.nabble.com/Possible-bug-tp41943p41946.html
To unsubscribe from Possible bug, click here.
NAML



--
View this message in context: http://gambas.8142.n7.nabble.com/Possible-bug-tp41943p41948.html
Sent from the gambas-user mailing list archive at Nabble.com.
Benoît Minisini
2013-05-14 23:43:09 UTC
Permalink
Hi Benoit,
It may, or may not, be good syntax but press F5 and Gambas crashes. You can not compile it because Gambas crashes.
The purpose of the code was to change "dir" string into a form tha BASH would accept from Shell command if there are spaces in the "dir" string.
I am not an expert in any of this. I am just tring to help by pointing this issue out. If it is a syntax error Gambas should detect this and not crash.
Regards,
Charlie.
Nothing special happens there. Can you make a project that crashes for me?
--
Benoît Minisini
Caveat
2013-05-14 23:32:28 UTC
Permalink
Yeah, I see what you're trying to do. You can use \\ to make a single \
as the \ is normally the first part of a special character constant
(e.g. \t makes a Tab character). I think you can just wrap file/dir
names with spaces in them in quotes for use in bash scripts.

Oh, and my Gambas doesn't crash with the code exactly as you had it. As
Benoit experienced, it just doesn't compile, same for me (compile error
is"Bad character constant").

Kind regards,
Caveat
Hi Benoit,
It may, or may not, be good syntax but press F5 and Gambas crashes. You can not compile it because Gambas crashes.
The purpose of the code was to change "dir" string into a form tha BASH would accept from Shell command if there are spaces in the "dir" string.
I am not an expert in any of this. I am just tring to help by pointing this issue out. If it is a syntax error Gambas should detect this and not crash.
Regards,
Charlie.
Post by Charlie
Hi all,
You need one *Button* and one *DirChooser* on your form
I have reduced code to the following to emulate this bug I am getting: -
'*********************************************************
Public Sub _new()
End
Public Sub Form_Open()
End
Public Sub Button1_Click()
Dim SDir As String
Sdir = DirChooser1.SelectedPath
SDir = Replace(SDir, " ", "\ ")
This line is not syntactically correct ("\ "). Please provide a project
or at least code that compiles!
Regards,
Charlie
2013-05-15 13:25:46 UTC
Permalink
Hi Caveat and Benoît,

Thanks for the replys. I will try a workaround, and I am pleased it's
not a issue for anybody else.

Should you be interested I have created a desktop video of the problem
and supplied the code that causes my Gambas to crash. You will find the
files at http://www.cogier.com/gambas/.

I have found that "SDir = Replace(SDir, " ", "\ ")" will cause a crash
but "SDir = Replace(SDir, " ", "\\ ")" is fine.

Thanks,

Charlie
Post by Caveat
Yeah, I see what you're trying to do. You can use \\ to make a single \
as the \ is normally the first part of a special character constant
(e.g. \t makes a Tab character). I think you can just wrap file/dir
names with spaces in them in quotes for use in bash scripts.
Oh, and my Gambas doesn't crash with the code exactly as you had it. As
Benoit experienced, it just doesn't compile, same for me (compile error
is"Bad character constant").
Kind regards,
Caveat
Hi Benoit,
It may, or may not, be good syntax but press F5 and Gambas crashes.
You can not compile it because Gambas crashes.
The purpose of the code was to change "dir" string into a form tha
BASH would accept from Shell command if there are spaces in the "dir"
string.
I am not an expert in any of this. I am just tring to help by
pointing this issue out. If it is a syntax error Gambas should detect
this and not crash.
Regards,
Charlie.
Sent from Charlie's Samsung tablet"Benoît Minisini [via Gambas]"
<[hidden email] </user/SendEmail.jtp?type=node&node=41950&i=0>>
Post by Charlie
Hi all,
You need one *Button* and one *DirChooser* on your form
I have reduced code to the following to emulate this bug I am
getting: -
Post by Charlie
'*********************************************************
Public Sub _new()
End
Public Sub Form_Open()
End
Public Sub Button1_Click()
Dim SDir As String
Sdir = DirChooser1.SelectedPath
SDir = Replace(SDir, " ", "\ ")
This line is not syntactically correct ("\ "). Please provide a project
or at least code that compiles!
Regards,
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Gambas-user mailing list
[hidden email] </user/SendEmail.jtp?type=node&node=41950&i=1>
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------
If you reply to this email, your message will be added to the
http://gambas.8142.n7.nabble.com/Possible-bug-tp41943p41950.html
To unsubscribe from Possible bug, click here
<http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=41943&code=Y2hhcmxpZUBjb2dpZXIuY29tfDQxOTQzfC0xMjY5ODcwMTc2>.
NAML
<http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
View this message in context: http://gambas.8142.n7.nabble.com/Possible-bug-tp41943p41957.html
Sent from the gambas-user mailing list archive at Nabble.com.
Olivier Cruilles
2013-05-15 14:11:37 UTC
Permalink
Hello Charlie,

I think you have this problem when the 'gb.qt4.ext' is not selected in the Preferencies -> Components.

Because this symbol depend on this component.

Cordialement,

Olivier Cruilles
Post by Charlie
Hi Caveat and Benoît,
Thanks for the replys. I will try a workaround, and I am pleased it's
not a issue for anybody else.
Should you be interested I have created a desktop video of the problem
and supplied the code that causes my Gambas to crash. You will find the
files at http://www.cogier.com/gambas/.
I have found that "SDir = Replace(SDir, " ", "\ ")" will cause a crash
but "SDir = Replace(SDir, " ", "\\ ")" is fine.
Thanks,
Charlie
Post by Caveat
Yeah, I see what you're trying to do. You can use \\ to make a single \
as the \ is normally the first part of a special character constant
(e.g. \t makes a Tab character). I think you can just wrap file/dir
names with spaces in them in quotes for use in bash scripts.
Oh, and my Gambas doesn't crash with the code exactly as you had it. As
Benoit experienced, it just doesn't compile, same for me (compile error
is"Bad character constant").
Kind regards,
Caveat
Hi Benoit,
It may, or may not, be good syntax but press F5 and Gambas crashes.
You can not compile it because Gambas crashes.
The purpose of the code was to change "dir" string into a form tha
BASH would accept from Shell command if there are spaces in the "dir"
string.
I am not an expert in any of this. I am just tring to help by
pointing this issue out. If it is a syntax error Gambas should detect
this and not crash.
Regards,
Charlie.
Sent from Charlie's Samsung tablet"Benoît Minisini [via Gambas]"
<[hidden email] </user/SendEmail.jtp?type=node&node=41950&i=0>>
Post by Charlie
Hi all,
You need one *Button* and one *DirChooser* on your form
I have reduced code to the following to emulate this bug I am
getting: -
Post by Charlie
'*********************************************************
Public Sub _new()
End
Public Sub Form_Open()
End
Public Sub Button1_Click()
Dim SDir As String
Sdir = DirChooser1.SelectedPath
SDir = Replace(SDir, " ", "\ ")
This line is not syntactically correct ("\ "). Please provide a project
or at least code that compiles!
Regards,
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Gambas-user mailing list
[hidden email] </user/SendEmail.jtp?type=node&node=41950&i=1>
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------
If you reply to this email, your message will be added to the
http://gambas.8142.n7.nabble.com/Possible-bug-tp41943p41950.html
To unsubscribe from Possible bug, click here
<http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=41943&code=Y2hhcmxpZUBjb2dpZXIuY29tfDQxOTQzfC0xMjY5ODcwMTc2>.
NAML
<http://gambas.8142.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
--
View this message in context: http://gambas.8142.n7.nabble.com/Possible-bug-tp41943p41957.html
Sent from the gambas-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Charlie
2013-05-15 16:58:44 UTC
Permalink
Hi Olivier Cruilles,

I have found a work around. As suggested earlier by Caveat using "// ". I
now have: -

*Public Sub Button1_Click()
Dim SDir As String

Sdir = DirChooser1.SelectedPath

SDir = "ls " & Replace(SDir, " ", "\\ ") & " > Temp.txt"
Shell SDir

End
*

The output to the shell is : -

*ls /home/charlie/This\ is\ a\ \ test\ directory > Temp.txt*

This even allows for more that one space in a directory name.

Thanks all for your help.

Charlie




--
View this message in context: http://gambas.8142.n7.nabble.com/Possible-bug-tp41943p41961.html
Sent from the gambas-user mailing list archive at Nabble.com.

Jussi Lahtinen
2013-05-15 15:41:11 UTC
Permalink
This bug doesn't seem to apply to Gambas 3.4.1.
So, try to update.

Jussi
Post by Charlie
Hi all,
You need one *Button* and one *DirChooser* on your form
I have reduced code to the following to emulate this bug I am getting: -
'*********************************************************
Public Sub _new()
End
Public Sub Form_Open()
End
Public Sub Button1_Click()
Dim SDir As String
Sdir = DirChooser1.SelectedPath
SDir = Replace(SDir, " ", "\ ")
End
'*********************************************************
Run the program and it crashes Gambas every time.
Any ideas?
Thanks,
Charlie
[System]
OperatingSystem=Linux
Kernel=3.5.0-17-generic
Architecture=i686
Memory=8182136 kB
DistributionVendor=LinuxMint
DistributionRelease="Linux Mint 14 Nadia"
Desktop=Gnome
[Gambas 3]
Version=3.1.1
Path=/usr/bin/gbx3
[Libraries]
Qt4=libQtCore.so.4.8.3
GTK+=libgtk-x11-2.0.so.0.2400.13
--
http://gambas.8142.n7.nabble.com/Possible-bug-tp41943.html
Sent from the gambas-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Gambas-user mailing list
https://lists.sourceforge.net/lists/listinfo/gambas-user
Loading...