Re: [Gambas-user] Where is the mistake?

2019-04-08 Thread nando_f
I'd like to point out that the five uses of 'Now' in the example all occur at different times - but very close together temporally. A better test is to use only one 'Now' in the program into a variable and format with the different lines. -- Open WebMail Project (http://openwebmail.org)

Re: [Gambas-user] Class array - Null Object

2018-01-28 Thread nando_f
For TheCounter = 0 To 100 TheArray[TheCounter] = New Class1 <--- you need to create a new object at each element TheArray[TheCounter].I = TheCounter< Your error because no object at the element exists. You only created the array. -- Open WebMail Project (http://openwe

Re: [Gambas-user] SocketServer issue

2017-09-25 Thread nando_f
My first guess would be that a socket server can't listen on a port without an IP associated with it. If your network connection is DHCP then the server can't listen. It you have a hard IP, then it can. -- Open WebMail Project (http://openwebmail.org) -- Original Message --- Fr

Re: [Gambas-user] New domain name for Gambas

2017-09-01 Thread nando_f
Gambas.ca is available I am in Canada, I will donate purchase it for you on an on-going basis. -Fernando (in Canada) -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: Benoît Minisini via Gambas-user To: gambas-user@lists.sourceforge.net Cc: Benoît Mi

Re: [Gambas-user] reading files

2017-07-17 Thread nando_f
I think Read #hfile, IDtag, ID3v1_TAG should be Read #hfile, IDtag as ID3v1_TAG -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: Shane To: gambas-user@lists.sourceforge.net Sent: Tue, 18 Jul 2017 10:50:43 +1000 Subject: Re: [Gambas

Re: [Gambas-user] reading files

2017-07-17 Thread nando_f
Yes it is possible, I do it. here is some code (incomplete) -Nando (Canada) ' top of class file Public Struct recstruc _a as integer _b as integer _c as integer end struct ' a function public function openAfile(filename as string) as file dim hfile as file dim arec as recstruc hfile

Re: [Gambas-user] Best ways to format float values

2017-07-16 Thread nando_f
Rounding depends on what rounding you want. Most people think of 5/4 rounding. I prefer to round manually 5/4... 5 up, 4 down. Dim n as Float = 26.6601 n = n * 100. 'n = 2666.01 ' 2 decimal points rounding n = n + 0.5 'n = 2666.51 ' 5/4 rounding* n = CLong(n) 'n =

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-07-01 Thread nando_f
there are much faster ways...just a little more intricate. Nando -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: Fernando Cabral To: mailing list for gambas users Sent: Sat, 1 Jul 2017 00:18:42 -0300 Subject: Re: [Gambas-user] I need a hint on h

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-27 Thread nando_f
Well, there is complicated, then there is simplicity: I tested this. Works for sorted, unsorted. Can't be any simpler. Public Function RemoveMultiple(a As String[]) As String[] Dim x as Integer Dim z as NEW STRING[] For x = 1 to a.count() if z.Find(a) = 0 Then z.Add(a[x]) Next 'if you want it

Re: [Gambas-user] I need a hint on how to deleted duplicate items in a array

2017-06-27 Thread nando_f
Another very effective and simple would be: You have your array with data You create a new empty array. Loop through each item in your array with data If it's not in the new array, then add it. Destroy the original array. Keep the new one. ...something like (syntax may not be correct) Public Fu

Re: [Gambas-user] usage of too much GOTO can be bad pracitce or make influence in the code?

2017-06-22 Thread nando_f
Sometimes GOTO is needed...especially if you want your code to run faster. Used properly and judiciously, it can make code reading much easier. -- Open WebMail Project (http://openwebmail.org) -- Original Message --- From: Cristiano Guadagnino To: mailing list for gambas users

Re: [Gambas-user] Serial I/O with byte data

2017-05-15 Thread nando_f
My reply to the comment: > Gambas Strings are not null-terminated and can > contain any sequence of bytes, which includes non-printable characters > (which I think is what you meant by "unreadable" characters). You should always consider String as an array of bytes. Just because humans can't read

Re: [Gambas-user] Serial I/O with byte data

2017-05-09 Thread nando_f
I have used Gambas serial port for 12 years now without problems. If there is nothing in the serial port queue, then that line might block. I use this: . . . L=Lof(Sport) 'how much is there now? if L>1 then L=L-1'leave at least one byte for next time around. i

Re: [Gambas-user] How to send data to SerialPort from Module?

2017-01-03 Thread nando_f
One way is to make a function is Fmain which is public called (for example) public Function Print_Sport(s as String) 'this is in Fmain print #sport, s, len(s) end function Outside fmain, you can call Fmail.Print_Sport(Chr$(&H1B) & Chr$(&H61)) because it is visible -Fernando -- Open WebMail

Re: [Gambas-user] Arrays of Structs

2016-11-29 Thread nando_f
I use structs to write binary to a file in struct order. Nice and easy. Not so easy with a class. Your example is possible. I have done similar. The STRUCT only defines the structure...it doesn't create the memory allocation. Static Private WorldMap[100, 100] As MapObject just defines arrays to

Re: [Gambas-user] Serial Port issues and events.

2016-06-30 Thread nando_f
I've done extensive work with the serial port for a dozen years with 100% success 24 hour operation. Sometimes people get mixed up with "0x02" thinking it's binary. That is 4 characters ascii. I prefer to use chr(2) to create a 1 length string binary 2. If you're going to use byte[] array then byt