Re: [Gambas-user] Gambas extern declarations `how to`

2013-11-05 Thread Fabien Bodard
It seem good ... have you take look to how to call my device structure via a READ as gbStruct ? 2013/11/6 Benoît Minisini : > Here is a documentation page about how to declare an extern function. > > http://gambasdoc.org/help/doc/extern?v3 > > This page tries to answer the question: if I have tha

Re: [Gambas-user] Unexecuted Orphan Code or Something?

2013-11-05 Thread nando
I would like to point out, if you have not noticed, that the RETURN string uses NOW 4 or 6 times (6 if the concatenatation is fixed proper). Please note that NOW is a little different every one of those times. If the code executed a fraction of a moment before to after midnight you would see the od

Re: [Gambas-user] extracting a fractional year from a date

2013-11-05 Thread Kevin Fishburne
On 11/05/2013 09:16 PM, Benoît Minisini wrote: > Le 06/11/2013 03:04, Kevin Fishburne a écrit : >> If you have a Date, is there a reasonably simple way to extract which >> fraction of the year it is? For example a date of 12:00 am on January >> 1st would return zero and 11:49 pm on December 31st wo

Re: [Gambas-user] extracting a fractional year from a date

2013-11-05 Thread Benoît Minisini
Le 06/11/2013 03:04, Kevin Fishburne a écrit : > If you have a Date, is there a reasonably simple way to extract which > fraction of the year it is? For example a date of 12:00 am on January > 1st would return zero and 11:49 pm on December 31st would return one. > The stuff I'm trying now using the

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Benoît Minisini
Le 06/11/2013 03:01, Bruce a écrit : > p.s. Just saw Benoît's wiki update notice. Did that page exist before? > I spent an hour this morning looking for something like that. > No, I just wrote it. I will complete it as new questions will have to be answered. -- Benoît Minisini ---

[Gambas-user] extracting a fractional year from a date

2013-11-05 Thread Kevin Fishburne
If you have a Date, is there a reasonably simple way to extract which fraction of the year it is? For example a date of 12:00 am on January 1st would return zero and 11:49 pm on December 31st would return one. The stuff I'm trying now using the Month and Day functions seems...wrong. If there's

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Bruce
> On Wed, Nov 6, 2013 at 2:56 AM, Benoît Minisini < > gam...@users.sourceforge.net> wrote: > > > Now your code: > > > > -- > 8*< > > > OP must points at a 16 bytes allocation. So you failed! The > > library will erase the memo

[Gambas-user] Gambas extern declarations `how to`

2013-11-05 Thread Benoît Minisini
Here is a documentation page about how to declare an extern function. http://gambasdoc.org/help/doc/extern?v3 This page tries to answer the question: if I have that C datatype, which Gambas datatype must be used, and how? Tell me if something is missing, or if you have C datatype you can't sol

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Jussi Lahtinen
Correct code: ' void uuid_generate(uuid_t out); Extern UUID_Gen(op As Pointer) In "libuuid:1" Exec "uuid_generate" ' void uuid_unparse(uuid_t uu, char *out) Extern UUID_ToStr(ip As Pointer, op As Pointer) In "libuuid:1" Exec "uuid_unparse" Public Sub Main() Dim OP As Pointer = Alloc(SizeOf(g

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Benoît Minisini
Le 06/11/2013 01:07, Benoît Minisini a écrit : > > What is the exact definition of 'uuid_t' ? > > Also, you can use valgrind to know when exactly the faulty memory > access occurs. This will give better clues. > typedef unsigned char uuid_t[16]; You get it in the '/usr/include/uuid.h', that you m

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Jussi Lahtinen
Not sure what is going on... too tired to focus properly. I'll look it later more closely. Instead of "= Alloc(IIf(sArch = "x86", 4, 8))", just write "SizeOf(gb.Pointer)". These functions doesn't return anything, so: Extern UUID_Gen(op As Pointer) As Pointer In "libuuid:1" Exec "uuid_generate"

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Bruce
On Wed, 2013-11-06 at 01:07 +0100, Benoît Minisini wrote: > What is the exact definition of 'uuid_t' ? > From http://linux.die.net/man/3/uuid_unparse The uuid_unparse function converts the supplied UUID uu from the binary representation into a 36-byte string (plus tailing '\0') of the form 1b4e

Re: [Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Benoît Minisini
Le 06/11/2013 00:58, Bruce a écrit : > Dear experts, > > Can anyone see what I'm doing wrong here. Source archive is attached, > but here is the entire code: > > -- > ' Gambas module file > > ' void uuid_generate(uuid_t out); > Ex

[Gambas-user] Segfault when freeing pointer used for Extern

2013-11-05 Thread Bruce
Dear experts, Can anyone see what I'm doing wrong here. Source archive is attached, but here is the entire code: -- ' Gambas module file ' void uuid_generate(uuid_t out); Extern UUID_Gen(op As Pointer) As Pointer In "libuuid:1"

Re: [Gambas-user] Specifications for Gambas 3 packaging : updated!

2013-11-05 Thread Kende Krisztián
2013-11-05 21:28 keltezéssel, Sebastian Kulesz írta: > First builds are starting to appear :) > I will wait for the armhf builds to finish to send a notice. > > If you want to touch the recipes in any way, please feel *free* to do so. I > will receive a notification about any changes, so there is n

Re: [Gambas-user] if-else vs try who are best faster inmachine time?

2013-11-05 Thread Jussi Lahtinen
> >> Why not simply write benchmark? > how tipycally geek-like response, well Sebastian has the right > response lest explaint more: > >> > > > > A benchmark wouldn't be accurate, as it will be IO bound, and being an > old > of course, the benchmark software will run in same machine (the only > cas

Re: [Gambas-user] Specifications for Gambas 3 packaging : updated!

2013-11-05 Thread Sebastian Kulesz
First builds are starting to appear :) I will wait for the armhf builds to finish to send a notice. If you want to touch the recipes in any way, please feel *free* to do so. I will receive a notification about any changes, so there is no need to announce them. On Nov 4, 2013 6:25 AM, "Sebastian Ku

Re: [Gambas-user] if-else vs try who are best faster in machine time?

2013-11-05 Thread Tobias Boege
On Mon, 04 Nov 2013, Sebastian Kulesz wrote: > On Mon, Nov 4, 2013 at 6:43 PM, Jussi Lahtinen > wrote: > > > Why not simply write benchmark? > > > > A benchmark wouldn't be accurate, as it will be IO bound, and being an old > machine, better reduce disk IO than CPU usage (I'm guessing it uses ID

Re: [Gambas-user] Unexecuted Orphan Code or Something?

2013-11-05 Thread Fabien Bodard
this Return "Today" & Format(Date(Year(Now), Month(Now), iTp1), "") & ", the " & Format(Date(Year(Now), Month(Now), iTp1), "d") & fuFormatSuffix(iTp1) ' "Of" & Format(Date(Year(Now), Month(Now), iTp1), ", "

Re: [Gambas-user] if-else vs try who are best faster in machine time?

2013-11-05 Thread PICCORO McKAY Lenz
yes, thanks all, the write-acces change all the question.. While "if-else" is the faster (i see code logic of gambas process), no disk access care checks, so then i use the if-else, due the disk are biger and the OS+files only are 400Mb, also the verification only happen on the user home, so the w

Re: [Gambas-user] if-else vs try who are best faster inmachine time?

2013-11-05 Thread PICCORO McKAY Lenz
From: Sebastian Kulesz >> Why not simply write benchmark? how tipycally geek-like response, well Sebastian has the right response lest explaint more: >> > > A benchmark wouldn't be accurate, as it will be IO bound, and being an old of course, the benchmark software will run in same machine (the on

Re: [Gambas-user] Unexecuted Orphan Code or Something?

2013-11-05 Thread Bruce
On Tue, 2013-11-05 at 06:34 -0800, 2aq9j93b7s wrote: > thank you for the replies I appreciate them > > Unfortunately you are missing the point of the post! I have an uncommeneted > line of code that is not and cannot be executed > > bruce > "Now do you see why that last line is not executed." > M

Re: [Gambas-user] Unexecuted Orphan Code or Something?

2013-11-05 Thread Benoît Minisini
Le 05/11/2013 15:34, 2aq9j93b7s a écrit : > thank you for the replies I appreciate them > > Unfortunately you are missing the point of the post! I have an uncommeneted > line of code that is not and cannot be executed > > bruce > "Now do you see why that last line is not executed." > My point exact

Re: [Gambas-user] Unexecuted Orphan Code or Something?

2013-11-05 Thread 2aq9j93b7s
thank you for the replies I appreciate them Unfortunately you are missing the point of the post! I have an uncommeneted line of code that is not and cannot be executed bruce "Now do you see why that last line is not executed." My point exactly but when is it executed if at all? Fabien Bodard-4

Re: [Gambas-user] Destroying Forms Question

2013-11-05 Thread Benoît Minisini
Le 05/11/2013 07:03, richard terry a écrit : > Hi List, > > Simple question. If I have a form I've created an instance of attatched > to say a tab strip on another form, but I want to destroy the form under > some circumstances, what's the best way to do this. > I've tried Form.close, doesn't work

Re: [Gambas-user] Using a class as a function

2013-11-05 Thread Bruce
On Tue, 2013-11-05 at 12:34 +0100, Fabien Bodard wrote: > In your class : > > Public sub _Call(value as whatyouwant) as whatyouwant > > End > > With that you can do > > Print Myclass(value) > Le 5 nov. 2013 12:10, "Bruce" a écrit : > > > I saw an example of how to do this only yesterday. > >

Re: [Gambas-user] Using a class as a function

2013-11-05 Thread Fabien Bodard
In your class : Public sub _Call(value as whatyouwant) as whatyouwant End With that you can do Print Myclass(value) Le 5 nov. 2013 12:10, "Bruce" a écrit : > I saw an example of how to do this only yesterday. > Do you think I can remember where? No. > > Any clues? > Bruce > > > >

[Gambas-user] Using a class as a function

2013-11-05 Thread Bruce
I saw an example of how to do this only yesterday. Do you think I can remember where? No. Any clues? Bruce -- November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming