[Gambas-user] Shell command formating

2017-08-06 Thread Shane
So again on the shell command I have this code Dim result As String Dim command As String path = File.SetExt(file_name, "ihx") command = "stm8flash -c stlinkv2 -p " & stmdevice & " -w " & path Shell command To result FMain.TextArea1.Text = result but the output is going to stdout and not th

Re: [Gambas-user] Shell command

2017-08-06 Thread Shane
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

Re: [Gambas-user] Shell command

2017-08-06 Thread Shane
Same thing here is a file with the output On 07/08/17 11:10, Tony Morehen wrote: what is the output of the shell line? If you could post the complete output, we could properly test your code. You could try this line: devices = Split(sdevices, " ", "", True) On 2017-08-06 08:35 PM, Shane w

Re: [Gambas-user] Shell command

2017-08-06 Thread Jussi Lahtinen
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 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 gues

Re: [Gambas-user] Shell command

2017-08-06 Thread Tony Morehen
what is the output of the shell line? If you could post the complete output, we could properly test your code. You could try this line: devices = Split(sdevices, " ", "", True) On 2017-08-06 08:35 PM, Shane wrote: Hi Jussi I gave that a try by commenting that line out still the same result

Re: [Gambas-user] Shell command

2017-08-06 Thread Shane
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

Re: [Gambas-user] Difference DateDiff(...) ?

2017-08-06 Thread Tony Morehen
You're right. Print is not the problem. Another part of Gambas could raise an error. But Benoit is right. Doing this kind of check is too resource intensive. You're also right. Since DateDiff(gb.second) will overflow for a ~70 year difference, over the longer term, it should return a long

Re: [Gambas-user] Difference DateDiff(...) ?

2017-08-06 Thread d4t4full
Toni, I don't think Print is at fault here at all. My guess is that DateDiff may need an "attitude adjustment" in these cases: It may need to either raise an overflow error or return a 64bit Long. Hope this helps, zxMarce. On Aug 6, 2017, 12:00, at 12:00, Tony Morehen wrote: >zxMarce, you a

[Gambas-user] [CRASH REPORT] gbUDisk2

2017-08-06 Thread Tony Morehen
Hello all, Damn, my program crashed Gambas this way : 1) Run the program 2) Plug in a usb drive 3) Click the mount button, mounts OK 4) Click the unmount button Program crashes Aborted(6) Console shows realloc error invalid old size Background: I'm writing a Udisks2 module that communicates wit

Re: [Gambas-user] Difference DateDiff(...) ?

2017-08-06 Thread Tony Morehen
zxMarce, you are exactly right. DateDiff returns an integer so when print adds the two datediff it adds 2 signed integers and gets an signed integer. Since the max value of a signed integer is 2147483647, the answer of 2208988800 overflows to -2085978496. So print's behaviour is as expected.

Re: [Gambas-user] Difference DateDiff(...) ?

2017-08-06 Thread d4t4full
Without a machine nearby, I'd risk you're in the right track. The DIM AS LONG creates 64bit vars while DateDiff may return 32bit data (don't have the docs with me). Print will use 64bit to print the vars and 32bit with direct DateDiff (you may confirm by using CLng to affect the DateDiff's in t

[Gambas-user] Difference DateDiff(...) ?

2017-08-06 Thread Hans Lehmann
Hello, Why are two different results: Public Sub Main() Dim a, b As Long a = DateDiff("01/01/1900", "01/01/1935", gb.Second) b = DateDiff("01/01/1935", "01/01/1970 ", gb.Second) Print a + b Print DateDiff("01/01/1900", "01/01/1935", gb.Second) + DateDiff("01/01/1935", "01/01/1970 ",

Re: [Gambas-user] Shell command

2017-08-06 Thread Jussi Lahtinen
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 wrote: > I have this in a sub fo