[Gambas-user] Shell command
Shane
buster6seven at ...626...
Mon Aug 7 03:32:06 CEST 2017
here is all the code
Public sdevices As String
Public Sub SaveOps_Click()
Settings["Options/CCompCLine"] = TextBox1.Text
Settings["Options/stmDevice"] = ComboBox1.Current
'Settings.Save()
Me.Close
End
Public Sub Form_Open()
Dim devices As String[]
Dim d As String
'
'TextBox1.Text = Settings["Options/CCompCLine"]
Shell "stm8flash -l" To sdevices
'sdevices = Replace(sdevices, "\n", "")
' fill combobox with devices
devices = Split(sdevices, " ", "", True)
For Each d In devices
ComboBox1.Add(d)
Next
' ComboBox1.Find(Settings["Options/stmDevice"])
Print "end"
End
Public Sub Button1_Click()
Me.Close
End
and system info
[System]
Gambas=3.10.90
OperatingSystem=Linux
Kernel=4.4.0-45-generic
Architecture=x86_64
Distribution=Linux Mint 17.2 Rafaela
Desktop=MATE
Theme=Gtk
Language=en_AU.UTF-8
Memory=3805M
[Libraries]
Cairo=libcairo.so.0.0.0
Cairo=libcairo.so.2.11301.0
Curl=libcurl.so.4.3.0
DBus=libdbus-1.so.3.7.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.204.0
GTK+2=libgtk-x11-2.0.so.0.2400.23
GTK+3=libgtk-3.so.0.1000.8
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.44.0.0
QT4=libQtCore.so.4.8.6
QT5=libQt5Core.so.5.2.1
QT5=libQt5Core.so.5.8.0
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6
[Environment]
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-o3iPH8ksHu,guid=7e7674d387bd0d61a1434e3e5987a82c
DEFAULTS_PATH=/usr/share/gconf/mate.default.path
DESKTOP_SESSION=mate
DISPLAY=:0.0
GB_GUI=gb.qt4
GDMSESSION=mate
GDM_XSERVER_LOCATION=local
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-NMrGUV
GNOME_KEYRING_PID=2227
GPG_AGENT_INFO=/run/user/1000/keyring-NMrGUV/gpg:0:1
HOME=<home>
KICAD_PATH=/usr/share/kicad
KIGITHUB=https://github.com/KiCad
LANG=en_AU.UTF-8
LOGNAME=<user>
MANDATORY_PATH=/usr/share/gconf/mate.mandatory.path
MATE_DESKTOP_SESSION_ID=this-is-deprecated
MDMSESSION=mate
MDM_LANG=en_AU.UTF-8
MDM_XSERVER_LOCATION=local
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PWD=<home>
SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/1540,unix/<hostname>:/tmp/.ICE-unix/1540
SHELL=/bin/bash
SSH_AGENT_PID=2046
SSH_AUTH_SOCK=/run/user/1000/keyring-NMrGUV/ssh
TEXTDOMAIN=im-config
TEXTDOMAINDIR=/usr/share/locale/
TZ=:/etc/localtime
USER=<user>
USERNAME=<user>
WINDOWPATH=8
XAUTHORITY=<home>/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-mate:/etc/xdg
XDG_CURRENT_DESKTOP=MATE
XDG_DATA_DIRS=/usr/share/mate:/usr/local/share/:/usr/share/:/usr/share/mdm/
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_COOKIE=139d2632112d070b9e811bbc561842ce-1502062630.656915-940133850
XDG_SESSION_DESKTOP=mate
XDG_SESSION_ID=c1
XDG_VTNR=8
On 07/08/17 11:29, Jussi Lahtinen wrote:
> Is that all the code in the form? Can you give your system information?
>
>
> Jussi
>
> On Mon, Aug 7, 2017 at 3:35 AM, Shane <buster6seven at ...626...> wrote:
>
>> Hi Jussi
>>
>> I gave that a try by commenting that line out still the same result so
>> that not the problem
>>
>>
>>
>>
>> On 06/08/17 22:17, Jussi Lahtinen wrote:
>>
>>> I guess settings component can't handle saving of arbitrary object. In
>>> this
>>> case "Settings["Options/stmDevice"] = ComboBox1.Current". Maybe you want
>>> to
>>> save ComboBox1.Current.Text?
>>> However there shouldn't be segfault.
>>>
>>>
>>> Jussi
>>>
>>> On Sun, Aug 6, 2017 at 7:18 AM, Shane <buster6seven at ...626...> wrote:
>>>
>>> I have this in a sub form
>>>> Public sdevices As String
>>>>
>>>>
>>>> Public Sub SaveOps_Click()
>>>>
>>>> Settings["Options/CCompCLine"] = TextBox1.Text
>>>> Settings["Options/stmDevice"] = ComboBox1.Current
>>>> 'Settings.Save()
>>>> Me.Close
>>>> End
>>>>
>>>> Public Sub Form_Open()
>>>> Dim devices As String[]
>>>> Dim d As String
>>>> '
>>>> TextBox1.Text = Settings["Options/CCompCLine"]
>>>> Shell "stm8flash -l" To sdevices
>>>> ' fill combobox with devices
>>>> devices = Split(sdevices, " ")
>>>> For Each d In devices
>>>> ComboBox1.Add(d)
>>>> Next
>>>> ' ComboBox1.Find(Settings["Options/stmDevice"])
>>>>
>>>> End
>>>>
>>>> but when I exit this form and then the main form i get s Seg fault
>>>>
>>>> but with the shell part commented out it is ok what am i doing wrong ?
>>>>
>>>> any ideas
>>>>
>>>> Thanks Shane
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>> _______________________________________________
>>>> Gambas-user mailing list
>>>> Gambas-user at lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>>
>>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list