Re: [Gambas-user] static ? in variables

2017-06-15 Thread PICCORO McKAY Lenz
tobias..now making a library  in the ide, the class that not have the
"create static" now not permits instanciate the class

i only put a variable static, rest of class not have create static

Export

Private dblocal As String = "file1.txt"
Static Public status As Integer = 0

now the class "dbcontext" said cannot be instanciate, i do not have
the CREATE PRIVATE declaration inside it!




Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-06-15 16:07 GMT-04:00 PICCORO McKAY Lenz :

> ok tobias, i reading and property translated to spanish.. thanks for your
> help.. (umm i thnik was too compresed the info.. but in any case ...)
>
> http://gambaswiki.org/wiki/lang/createstatic?l=es
>
> please for spanish use revised and compelte if need..
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2017-06-15 15:15 GMT-04:00 PICCORO McKAY Lenz :
>
>> hi tobias, please , change you the now modified wiki page.. i changed
>> maybe before u read it!
>>
>> and also change the spanish too, http://gambaswiki.org/wik
>> i/lang/createstatic?l=es
>>
>> please change you or revised the actual and made right corrections.. i
>> think u visit the wiki after i made the changes.. i must added parto of
>> your explanation due the wiki has confuse info..
>>
>> i will monitoring the wiki after you made some changes to also update the
>> spanish part
>>
>> Lenz McKAY Gerardo (PICCORO)
>> http://qgqlochekone.blogspot.com
>>
>> 2017-06-15 15:02 GMT-04:00 Tobias Boege :
>>
>>> On Thu, 15 Jun 2017, PICCORO McKAY Lenz wrote:
>>> > hi tobias, *the documentation are totally wrong.. due the documentation
>>> > makes a explicit citation to the concep in wikipedia*,that's why i ask
>>> so
>>> > many about it
>>> >
>>> > now i propose to change by myselft that documentation to a proper
>>> paragraph
>>> > that translators can understand without transliterate the meaning..
>>> >
>>> > and in any case thanks to your explication now i can understand the
>>> right
>>> > usage..
>>> >
>>> > with this specific problem i can point the importance of a
>>> documentation,
>>> > i'll practice some all of your said and then try to correct better the
>>> wiki
>>> > doc
>>> >
>>>
>>> Well, I read the wiki page again after you pointed this out and,
>>> technically
>>> speaking, the wiki is correct:
>>>
>>>   This feature allows you to implement the object-oriented programming
>>> singleton pattern.
>>>
>>> Indeed CREATE STATIC allows you to implement the familiar singleton
>>> pattern,
>>> but CREATE STATIC *alone* does not suffice. To get the singleton you
>>> have to
>>> use
>>>
>>>   CREATE STATIC
>>>   CREATE PRIVATE
>>>
>>> together (CREATE PRIVATE is linked on the CREATE STATIC page and it
>>> disallows the creation of objects of a class, except for the automatic
>>> instance, because the interpreter can and will bypass the CREATE PRIVATE
>>> limit to fulfill the CREATE STATIC flag).
>>>
>>> Maybe this is all that's needed for the clarification. If you agree that
>>> CREATE STATIC + CREATE PRIVATE = singleton pattern, then I can change
>>> the wiki page, with slightly better English I believe.
>>>
>>> Regards,
>>> Tobi
>>>
>>> --
>>> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>>>
>>> 
>>> --
>>> 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@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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] static ? in variables

2017-06-15 Thread PICCORO McKAY Lenz
ok tobias, i reading and property translated to spanish.. thanks for your
help.. (umm i thnik was too compresed the info.. but in any case ...)

http://gambaswiki.org/wiki/lang/createstatic?l=es

please for spanish use revised and compelte if need..

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-06-15 15:15 GMT-04:00 PICCORO McKAY Lenz :

> hi tobias, please , change you the now modified wiki page.. i changed
> maybe before u read it!
>
> and also change the spanish too, http://gambaswiki.org/
> wiki/lang/createstatic?l=es
>
> please change you or revised the actual and made right corrections.. i
> think u visit the wiki after i made the changes.. i must added parto of
> your explanation due the wiki has confuse info..
>
> i will monitoring the wiki after you made some changes to also update the
> spanish part
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
> 2017-06-15 15:02 GMT-04:00 Tobias Boege :
>
>> On Thu, 15 Jun 2017, PICCORO McKAY Lenz wrote:
>> > hi tobias, *the documentation are totally wrong.. due the documentation
>> > makes a explicit citation to the concep in wikipedia*,that's why i ask
>> so
>> > many about it
>> >
>> > now i propose to change by myselft that documentation to a proper
>> paragraph
>> > that translators can understand without transliterate the meaning..
>> >
>> > and in any case thanks to your explication now i can understand the
>> right
>> > usage..
>> >
>> > with this specific problem i can point the importance of a
>> documentation,
>> > i'll practice some all of your said and then try to correct better the
>> wiki
>> > doc
>> >
>>
>> Well, I read the wiki page again after you pointed this out and,
>> technically
>> speaking, the wiki is correct:
>>
>>   This feature allows you to implement the object-oriented programming
>> singleton pattern.
>>
>> Indeed CREATE STATIC allows you to implement the familiar singleton
>> pattern,
>> but CREATE STATIC *alone* does not suffice. To get the singleton you have
>> to
>> use
>>
>>   CREATE STATIC
>>   CREATE PRIVATE
>>
>> together (CREATE PRIVATE is linked on the CREATE STATIC page and it
>> disallows the creation of objects of a class, except for the automatic
>> instance, because the interpreter can and will bypass the CREATE PRIVATE
>> limit to fulfill the CREATE STATIC flag).
>>
>> Maybe this is all that's needed for the clarification. If you agree that
>> CREATE STATIC + CREATE PRIVATE = singleton pattern, then I can change
>> the wiki page, with slightly better English I believe.
>>
>> Regards,
>> Tobi
>>
>> --
>> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>>
>> 
>> --
>> 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@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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] static ? in variables

2017-06-15 Thread PICCORO McKAY Lenz
hi tobias, please , change you the now modified wiki page.. i changed maybe
before u read it!

and also change the spanish too,
http://gambaswiki.org/wiki/lang/createstatic?l=es

please change you or revised the actual and made right corrections.. i
think u visit the wiki after i made the changes.. i must added parto of
your explanation due the wiki has confuse info..

i will monitoring the wiki after you made some changes to also update the
spanish part

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-06-15 15:02 GMT-04:00 Tobias Boege :

> On Thu, 15 Jun 2017, PICCORO McKAY Lenz wrote:
> > hi tobias, *the documentation are totally wrong.. due the documentation
> > makes a explicit citation to the concep in wikipedia*,that's why i ask so
> > many about it
> >
> > now i propose to change by myselft that documentation to a proper
> paragraph
> > that translators can understand without transliterate the meaning..
> >
> > and in any case thanks to your explication now i can understand the right
> > usage..
> >
> > with this specific problem i can point the importance of a documentation,
> > i'll practice some all of your said and then try to correct better the
> wiki
> > doc
> >
>
> Well, I read the wiki page again after you pointed this out and,
> technically
> speaking, the wiki is correct:
>
>   This feature allows you to implement the object-oriented programming
> singleton pattern.
>
> Indeed CREATE STATIC allows you to implement the familiar singleton
> pattern,
> but CREATE STATIC *alone* does not suffice. To get the singleton you have
> to
> use
>
>   CREATE STATIC
>   CREATE PRIVATE
>
> together (CREATE PRIVATE is linked on the CREATE STATIC page and it
> disallows the creation of objects of a class, except for the automatic
> instance, because the interpreter can and will bypass the CREATE PRIVATE
> limit to fulfill the CREATE STATIC flag).
>
> Maybe this is all that's needed for the clarification. If you agree that
> CREATE STATIC + CREATE PRIVATE = singleton pattern, then I can change
> the wiki page, with slightly better English I believe.
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> 
> --
> 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@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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] static ? in variables

2017-06-15 Thread Tobias Boege
On Thu, 15 Jun 2017, PICCORO McKAY Lenz wrote:
> hi tobias, *the documentation are totally wrong.. due the documentation
> makes a explicit citation to the concep in wikipedia*,that's why i ask so
> many about it
> 
> now i propose to change by myselft that documentation to a proper paragraph
> that translators can understand without transliterate the meaning..
> 
> and in any case thanks to your explication now i can understand the right
> usage..
> 
> with this specific problem i can point the importance of a documentation,
> i'll practice some all of your said and then try to correct better the wiki
> doc
> 

Well, I read the wiki page again after you pointed this out and, technically
speaking, the wiki is correct:

  This feature allows you to implement the object-oriented programming 
singleton pattern.

Indeed CREATE STATIC allows you to implement the familiar singleton pattern,
but CREATE STATIC *alone* does not suffice. To get the singleton you have to
use

  CREATE STATIC
  CREATE PRIVATE

together (CREATE PRIVATE is linked on the CREATE STATIC page and it
disallows the creation of objects of a class, except for the automatic
instance, because the interpreter can and will bypass the CREATE PRIVATE
limit to fulfill the CREATE STATIC flag).

Maybe this is all that's needed for the clarification. If you agree that
CREATE STATIC + CREATE PRIVATE = singleton pattern, then I can change
the wiki page, with slightly better English I believe.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Working with .so library

2017-06-15 Thread Tobias Boege
> > > > What I don't understand is how I construct the code in my
> > > > particular case.
> > > > 
> > > > To make an interface to the library I declare external pointer
> > > > like this:
> > > > 
> > > >  Extern CreateFptrInterface(ver As Integer) As Pointer
> > > > 
> > > > Then I declare some pointers that I'll use with help of the interface I
> > > > created:
> > > > 
> > > >  Extern put_DeviceEnable(p as Pointer, mode as Integer)
> > > > 
> > > >  Extern GetStatus(p as Pointer, StatRequest as String)
> > > > 
> > > > Then I declare the pointer which will be that interface:
> > > > 
> > > >  Public kkmDrv as Pointer
> > > > 
> > > > So then in sub I can do
> > > > 
> > > > kkmDrv = CreateFptrInterface(12) ' this establishes the interface
> > > > 
> > > > put_DeviceEnabled(kkmDrv, 1) ' this transfers the comand to the library
> > > > through the interface.
> > > > 
> > > > And it works great.
> > > > 
> > > > But then If I want to get some data from the library, as I
> > > > understand, I
> > > > have to declare another pointer, allocate ram for it and pass my
> > > > request.
> > > > 
> > > > I don't understand how should I pass that pointer to GetStatus()
> > > > while also
> > > > passing my interface pointer to it, let alone reading data back.
> > > > Totally
> > > > confused.
> > > > 
> > > This entirely depends on how the C functions in your library are
> > > declared.
> > > I don't know about your specific library but commonly the occurence
> > > of an
> > > error is indicated by an integer return code, e.g. this might be the
> > > signature of one of the functions in your library:
> > > 
> > >int myfunction(void *interface, int argument)
> > > 
> > > If the documentation says that the return value (int) of this function
> > > indicates an error, then you just need to get that return value back
> > > into
> > > your Gambas program, which you accomplish by declaring the function in
> > > Gambas as
> > > 
> > >Extern myfunction(interface As Pointer, argument As Integer) As
> > > Integer
> > > 
> > > (notice the trailing "As Integer"). Then you can use "myfunction" in
> > > your
> > > Gambas code like any other function and get and interpret its return
> > > value.
> > > 
> > > So, if this convention for error reporting is used, it is much
> > > simpler to
> > > get information about errors, without using Alloc() and co. Your library
> > > may use a different convention which actually involves pointers, but
> > > I wouldn't know.
> > > 
> > > Regards,
> > > Tobi
> > > 
> > I should've said it in the beginning. Ofcourse any function returns
> > integer value of 0 as success or -1 as error, but that only indicates
> > that function was successfully executed or not. So GetStatus() will
> > always return 0 because it shurely ran, nothing can go wrong here. But
> > that's not the result I want. GetStatus() actually gives back a string
> > with the status I asked for. Not that I fully understand how it does
> > that. I already gave links to the libfptr.so library itself
> > (http://allunix.ru/back/atol.tar.gz) and it's header files
> > (http://allunix.ru/back/atol-header.tar.gz) so that it's clearer, what
> > I'm talking about, unfortunately I am absolute zero in C to figure
> > things out myself.
> > 
> > For example I can see that to get serial number of the device driven by
> > that library i can use a function described like this:
> > 
> > get_SerialNumber(void *ptr, wchar_t *bfr, int bfrSize);
> > 
> > As far as I can tell what it does is it gets data needed and puts it
> > into some buffer. The result of executing this function through
> > put_SerialNumber(kkmDrv) will always be returned to me as 0.
> > 
> > So to see what's in that buffer, I have to then invoke GetStatus(kkmDrv)
> > describe in .h file like GetStatus(void *ptr); and the integer result of
> > this operation will also always be 0, which means that GetStatus itself
> > ran successfully, but I don't care about that, I want to see what it
> > actually told me, not that if it told me it successfully or not. So
> > that's the main confusion. If all this is too complicated and lamely
> > explained then nevermind, I expect it to be so and I'm sorry, that's the
> > best I can do. I'm just really confused that I recieve two answers, one
> > boolean telling if function successfully invoked and one string,
> > carrying the actual data I want.
> > 
> > 
> > Best Regards,
> > 
> > Dmitry.
> > 
> UPD: you know, I can be fundamentally wrong about all this library's
> functionality. Maybe it does not give me any data afterall, I'm beginning to
> think that this integer (or rather boolean) value is all it gives me back,
> and the "real" data is just written into it's log file. Which is sufficient
> to me, so, I guess, nevermind. Sorry about wasting your time.
> 

Don't worry about wasting my time. If I didn't want to use it, I wouldn't
have looked at your mail.

Let's have a look at fptrexample.cpp in atol-header.tar.gz 

Re: [Gambas-user] static ? in variables

2017-06-15 Thread PICCORO McKAY Lenz
hi tobias, *the documentation are totally wrong.. due the documentation
makes a explicit citation to the concep in wikipedia*,that's why i ask so
many about it

now i propose to change by myselft that documentation to a proper paragraph
that translators can understand without transliterate the meaning..

and in any case thanks to your explication now i can understand the right
usage..

with this specific problem i can point the importance of a documentation,
i'll practice some all of your said and then try to correct better the wiki
doc

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-06-15 13:48 GMT-04:00 Tobias Boege :

> On Thu, 15 Jun 2017, PICCORO McKAY Lenz wrote:
> > thanks in advance, but i have now more questions:
> > 2017-06-15 8:41 GMT-04:00 Tobias Boege :
> >
> > > No, the word "singleton" here just means you get an automatic instance
> of
> > > your class, i.e. you can use the class name as if it were an object.
> You
> > >
> > automatic instance?
> >
> > maybe its a translation problem, but i try to understant: wiki said here:
> > http://gambaswiki.org/wiki/lang/createstatic
> > in a tip:
> > "allows you to implement the object-oriented programming singleton
> pattern
> > ."
> > and i understand by singleton pattern that a only one instance du i was a
> > J2EE programer:
> > "restricts the instantiation
> >  of
> a
> > class 
> to
> > one object  >.
> > This is useful when exactly one object is needed to coordinate actions
> > across the system"
> >
> > so here are some things that i cannot understant and i think its
> something
> > with translation or?
> >
>
> It's not a translation error, it is that "singleton" has a different
> meaning
> in the paragraph you cite than it has in Gambas. Actually, the
> documentation
> should probably avoid the word "singleton", because it creates confusion
> with
> a more established notion of "singleton" (the one you cite).
>
> Now, let me tell you again what the documentation means when it says
> "singleton". When you put the CREATE STATIC keyword into the top of your
> class, then the class will be made "auto-creatable". This means that if
> your Gambas program uses the class name like an object, e.g. by accessing
> a non-static property or method over the *class* name (which doesn't make
> sense), then the interpreter will create an object out of this class
> (the so-called automatic instance -- because the interpreter creates it
> automatically for you in the background as soon as you need it) and uses
> this object in place of the class name.
>
> CREATE STATIC does *not* ensure that you can create *only* one instance
> of the class. This is not what "singleton" means in Gambas. You can create
> multiple objects out of a CREATE STATIC class.
>
> There are two famous examples of auto-creatable (CREATE STATIC) classes,
> which I can think of off the top of my head:
>
>   (1) Settings (gb.settings), if you ever worked with it, is a class of
>   which you can create as many objects as you like, right? But you can
>   also use the class name "Settings" as if it were an object, e.g.
>
> Print Settings["Key"]
>
>   Here it looks you access a key "Key" of the class Settings, but this
>   doesn't make sense as the array accessors aren't static methods of
> the
>   Settings class. In fact, Settings, in this case, behaves as if you
>   created as Settings object behind the scenes which is linked to the
>   default configuration file path $XDG_CONFIG_HOME &/ Application.Name
> & ".conf".
>   This is precisely the automatic instance of the Settings class.
>
>   (2) An even more prominent example: every Form class is auto-creatable.
>   Have you ever wondered why, if you start your GUI project with
> startup
>   form "FMain", a window pops up? You only have a Form class but you
>   never created an object of this Form class, so where does this window
>   come from? This also is the automatic instance of your class FMain,
>   showing itself on startup. You can also write
>
> FMain.Center()
>
>   to center your main window on the screen. The class name "FMain"
>   does not refer to the class, but to the automatic instance, an
>   *object* of class FMain that the interpreter created and that is
>   used behind the scenes.
>
> This is the "singleton" behaviour that the documentation describes.
>
> >
> > > Nothing extraordinary happens. You have a dynamic class with a static
> > > variable and you can use the class like an object (as well as create
> new
> > > objects of that class).
> > >
> > for the variable:
> >
> > public statis var as string
> >
> > vs
> >
> > public var as strings
> >
> 

Re: [Gambas-user] static ? in variables

2017-06-15 Thread Tobias Boege
On Thu, 15 Jun 2017, PICCORO McKAY Lenz wrote:
> thanks in advance, but i have now more questions:
> 2017-06-15 8:41 GMT-04:00 Tobias Boege :
> 
> > No, the word "singleton" here just means you get an automatic instance of
> > your class, i.e. you can use the class name as if it were an object. You
> >
> automatic instance?
> 
> maybe its a translation problem, but i try to understant: wiki said here:
> http://gambaswiki.org/wiki/lang/createstatic
> in a tip:
> "allows you to implement the object-oriented programming singleton pattern
> ."
> and i understand by singleton pattern that a only one instance du i was a
> J2EE programer:
> "restricts the instantiation
>  of a
> class  to
> one object .
> This is useful when exactly one object is needed to coordinate actions
> across the system"
> 
> so here are some things that i cannot understant and i think its something
> with translation or?
> 

It's not a translation error, it is that "singleton" has a different meaning
in the paragraph you cite than it has in Gambas. Actually, the documentation
should probably avoid the word "singleton", because it creates confusion with
a more established notion of "singleton" (the one you cite).

Now, let me tell you again what the documentation means when it says
"singleton". When you put the CREATE STATIC keyword into the top of your
class, then the class will be made "auto-creatable". This means that if
your Gambas program uses the class name like an object, e.g. by accessing
a non-static property or method over the *class* name (which doesn't make
sense), then the interpreter will create an object out of this class
(the so-called automatic instance -- because the interpreter creates it
automatically for you in the background as soon as you need it) and uses
this object in place of the class name.

CREATE STATIC does *not* ensure that you can create *only* one instance
of the class. This is not what "singleton" means in Gambas. You can create
multiple objects out of a CREATE STATIC class.

There are two famous examples of auto-creatable (CREATE STATIC) classes,
which I can think of off the top of my head:

  (1) Settings (gb.settings), if you ever worked with it, is a class of
  which you can create as many objects as you like, right? But you can
  also use the class name "Settings" as if it were an object, e.g.

Print Settings["Key"]

  Here it looks you access a key "Key" of the class Settings, but this
  doesn't make sense as the array accessors aren't static methods of the
  Settings class. In fact, Settings, in this case, behaves as if you
  created as Settings object behind the scenes which is linked to the
  default configuration file path $XDG_CONFIG_HOME &/ Application.Name & 
".conf".
  This is precisely the automatic instance of the Settings class.

  (2) An even more prominent example: every Form class is auto-creatable.
  Have you ever wondered why, if you start your GUI project with startup
  form "FMain", a window pops up? You only have a Form class but you
  never created an object of this Form class, so where does this window
  come from? This also is the automatic instance of your class FMain,
  showing itself on startup. You can also write

FMain.Center()

  to center your main window on the screen. The class name "FMain"
  does not refer to the class, but to the automatic instance, an
  *object* of class FMain that the interpreter created and that is
  used behind the scenes.

This is the "singleton" behaviour that the documentation describes.

> 
> > Nothing extraordinary happens. You have a dynamic class with a static
> > variable and you can use the class like an object (as well as create new
> > objects of that class).
> >
> for the variable:
> 
> public statis var as string
> 
> vs
> 
> public var as strings
> 
> doc wiki said "will be shared with all the class" seems that there's no
> diference based on your answer
> 
> 

I don't understand your objection at all. Maybe the above explanation clears
things up for you?

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1113: ODBC driver problem: driver connects but does not exec query

2017-06-15 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1113=L21haW4-

Comment #4 by PICCORO LENZ MCKAY:

i'll made your suggestions, but please, 
pardom me, zxmarce, burt if are a low level driver manager problem why are 
working in console?
with php are working too!
there are other minor problems that php does not have and gambas yes.. 

next messager i'll provide the dump



--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1113: ODBC driver problem: driver connects but does not exec query

2017-06-15 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1113=L21haW4-

Comment #3 by zxMarce:

It is unlikely you will see any: If at least one method works, that kind of 
proves unixODBC and Gambas work with -at least- these combinations.
Just in case, please enable DEBUG in the ODBC component and try again in the 
Gambas IDE, dumping the console trace here to see if it is of any help.

This can be (let me stress CAN BE) a low-level driver problem; not all ODBC 
drivers implement all ODBC calls, and not all RDBMS out there may handle all 
ODBC commands.

Regards,
zxMarce.



--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] [Gambas Bug Tracker] Bug #1113: ODBC driver problem: driver connects but does not exec query

2017-06-15 Thread bugtracker
http://gambaswiki.org/bugtracker/edit?object=BUG.1113=L21haW4-

Comment #2 by PICCORO LENZ MCKAY:

any progress with this bug? i do not see some work in svn



--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] static ? in variables

2017-06-15 Thread PICCORO McKAY Lenz
thanks in advance, but i have now more questions:
2017-06-15 8:41 GMT-04:00 Tobias Boege :

> No, the word "singleton" here just means you get an automatic instance of
> your class, i.e. you can use the class name as if it were an object. You
>
automatic instance?

maybe its a translation problem, but i try to understant: wiki said here:
http://gambaswiki.org/wiki/lang/createstatic
in a tip:
"allows you to implement the object-oriented programming singleton pattern
."
and i understand by singleton pattern that a only one instance du i was a
J2EE programer:
"restricts the instantiation
 of a
class  to
one object .
This is useful when exactly one object is needed to coordinate actions
across the system"

so here are some things that i cannot understant and i think its something
with translation or?


> Nothing extraordinary happens. You have a dynamic class with a static
> variable and you can use the class like an object (as well as create new
> objects of that class).
>
for the variable:

public statis var as string

vs

public var as strings

doc wiki said "will be shared with all the class" seems that there's no
diference based on your answer


>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> 
> --
> 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@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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] I ask for examples of regex functions usage

2017-06-15 Thread Fernando Cabral
So far I have confined myself to using Regex.Replace (). Nevertheless, for
some applications I understand there are better ways to do things, like
compiling the regular expression before searching or replacing. Also, I
presume there are other conveniences available.

The documentation I have found so far hints on these possibilities, but
there are no full-fledged examples. I wonder if those of you who have been
using regex more extensively can send me (or point me to) some code sample
where the Regex family of methods and parameters are more intensively used.

Best regards

- fernando
-- 
Fernando Cabral
Blogue: http://fernandocabral.org
Twitter: http://twitter.com/fjcabral
e-mail: fernandojosecab...@gmail.com
Facebook: f...@fcabral.com.br
Telegram: +55 (37) 99988-8868
Wickr ID: fernandocabral
WhatsApp: +55 (37) 99988-8868
Skype:  fernandojosecabral
Telefone fixo: +55 (37) 3521-2183
Telefone celular: +55 (37) 99988-8868

Enquanto houver no mundo uma só pessoa sem casa ou sem alimentos,
nenhum político ou cientista poderá se gabar de nada.
--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] static ? in variables

2017-06-15 Thread Tobias Boege
On Thu, 15 Jun 2017, PICCORO McKAY Lenz wrote:
> "This keyword is used for declaring static variables, static methods and
> singleton classes."
> 
> About singleton clases, that mean guarantee a unique instance of..
>

No, the word "singleton" here just means you get an automatic instance of
your class, i.e. you can use the class name as if it were an object. You
do *not* get a unique instance. You have to use the CREATE PRIVATE keyword
for non-instantiable classes.

> but if
> the class are not static and have one variable static, what that's means?
> 

Nothing extraordinary happens. You have a dynamic class with a static
variable and you can use the class like an object (as well as create new
objects of that class).

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] static ? in variables

2017-06-15 Thread PICCORO McKAY Lenz
"This keyword is used for declaring static variables, static methods and
singleton classes."

About singleton clases, that mean guarantee a unique instance of.. but if
the class are not static and have one variable static, what that's means?

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Working with .so library

2017-06-15 Thread ML
On 15/06/17 08:48, Admin wrote:
> 15.06.2017 17:54, Admin пишет:
>> 15.06.2017 16:19, Tobias Boege пишет:
 All your help was very important for me, I now have completed my cash
 register software to the point where it does everything my company
 needs. I
 must say Gambas is a great language, it's very easy to learn from
 scratch,
 I'm surprised how obvious everything is. But there is a lot of work
 for me
 left to do mostly in terms of managing wrong human actions. My
 software
 works good if the employee doesn't do any mistakes, but that's
 unrealistic,
 so there's a lot of things I want to control and check. And that's
 where I'm
 stuck.
 This library (which still calls itself a driver) theoretically is
 able to
 return a lot of values that I need, but I can't understand basic
 rules of
 how do we take output from a C-lib in Gambas.
 From http://gambaswiki.org/wiki/howto/extern I understood that I
 need to
 locate a space in memory and pass a pointer to a library so that it
 can
 write data into that place in ram, which I would then read and set
 free.
 So I have to declare a pointer, then Alloc(8) it, then pass it to
 my library
 and then read from it like it is a stream. Does this principle
 still work in
 current version of Gambas?
>>> If you do Alloc(8), then you get 8 bytes of memory. You most likely
>>> *don't*
>>> want to read that like a stream, but use Integer@() or similar
>>> functions.
 What I don't understand is how I construct the code in my
 particular case.
 To make an interface to the library I declare external pointer like
 this:
  Extern CreateFptrInterface(ver As Integer) As Pointer
 Then I declare some pointers that I'll use with help of the
 interface I
 created:
  Extern put_DeviceEnable(p as Pointer, mode as Integer)
  Extern GetStatus(p as Pointer, StatRequest as String)
 Then I declare the pointer which will be that interface:
  Public kkmDrv as Pointer
 So then in sub I can do
 kkmDrv = CreateFptrInterface(12) ' this establishes the interface
 put_DeviceEnabled(kkmDrv, 1) ' this transfers the comand to the
 library
 through the interface.
 And it works great.
 But then If I want to get some data from the library, as I
 understand, I
 have to declare another pointer, allocate ram for it and pass my
 request.
 I don't understand how should I pass that pointer to GetStatus()
 while also
 passing my interface pointer to it, let alone reading data back.
 Totally
 confused.

>>> This entirely depends on how the C functions in your library are
>>> declared.
>>> I don't know about your specific library but commonly the occurence
>>> of an
>>> error is indicated by an integer return code, e.g. this might be the
>>> signature of one of the functions in your library:
>>>int myfunction(void *interface, int argument)
>>> If the documentation says that the return value (int) of this function
>>> indicates an error, then you just need to get that return value back
>>> into
>>> your Gambas program, which you accomplish by declaring the function in
>>> Gambas as
>>>Extern myfunction(interface As Pointer, argument As Integer) As
>>> Integer
>>> (notice the trailing "As Integer"). Then you can use "myfunction" in
>>> your
>>> Gambas code like any other function and get and interpret its return
>>> value.
>>> So, if this convention for error reporting is used, it is much
>>> simpler to
>>> get information about errors, without using Alloc() and co. Your
>>> library
>>> may use a different convention which actually involves pointers, but
>>> I wouldn't know.
>>> Regards,
>>> Tobi
>>>
>> I should've said it in the beginning. Ofcourse any function returns
>> integer value of 0 as success or -1 as error, but that only indicates
>> that function was successfully executed or not. So GetStatus() will
>> always return 0 because it shurely ran, nothing can go wrong here.
>> But that's not the result I want. GetStatus() actually gives back a
>> string with the status I asked for. Not that I fully understand how
>> it does that. I already gave links to the libfptr.so library itself
>> (http://allunix.ru/back/atol.tar.gz) and it's header files
>> (http://allunix.ru/back/atol-header.tar.gz) so that it's clearer,
>> what I'm talking about, unfortunately I am absolute zero in C to
>> figure things out myself.
>> For example I can see that to get serial number of the device driven
>> by that library i can use a function described like this:
>> get_SerialNumber(void *ptr, wchar_t *bfr, int bfrSize);
>> As far as I can tell what it does is it gets data needed and puts it
>> into some buffer. The result of executing this function through
>> put_SerialNumber(kkmDrv) will always be returned to me as 0.
>> So to see what's in that buffer, I have to then invoke
>> 

Re: [Gambas-user] Working with .so library

2017-06-15 Thread Admin

15.06.2017 17:54, Admin пишет:

15.06.2017 16:19, Tobias Boege пишет:

All your help was very important for me, I now have completed my cash
register software to the point where it does everything my company 
needs. I
must say Gambas is a great language, it's very easy to learn from 
scratch,
I'm surprised how obvious everything is. But there is a lot of work 
for me

left to do mostly in terms of managing wrong human actions. My software
works good if the employee doesn't do any mistakes, but that's 
unrealistic,
so there's a lot of things I want to control and check. And that's 
where I'm

stuck.

This library (which still calls itself a driver) theoretically is 
able to
return a lot of values that I need, but I can't understand basic 
rules of

how do we take output from a C-lib in Gambas.

 From http://gambaswiki.org/wiki/howto/extern I understood that I 
need to

locate a space in memory and pass a pointer to a library so that it can
write data into that place in ram, which I would then read and set 
free.


So I have to declare a pointer, then Alloc(8) it, then pass it to my 
library
and then read from it like it is a stream. Does this principle still 
work in

current version of Gambas?

If you do Alloc(8), then you get 8 bytes of memory. You most likely 
*don't*
want to read that like a stream, but use Integer@() or similar 
functions.


What I don't understand is how I construct the code in my particular 
case.


To make an interface to the library I declare external pointer like 
this:


 Extern CreateFptrInterface(ver As Integer) As Pointer

Then I declare some pointers that I'll use with help of the interface I
created:

 Extern put_DeviceEnable(p as Pointer, mode as Integer)

 Extern GetStatus(p as Pointer, StatRequest as String)

Then I declare the pointer which will be that interface:

 Public kkmDrv as Pointer

So then in sub I can do

kkmDrv = CreateFptrInterface(12) ' this establishes the interface

put_DeviceEnabled(kkmDrv, 1) ' this transfers the comand to the library
through the interface.

And it works great.

But then If I want to get some data from the library, as I 
understand, I
have to declare another pointer, allocate ram for it and pass my 
request.


I don't understand how should I pass that pointer to GetStatus() 
while also
passing my interface pointer to it, let alone reading data back. 
Totally

confused.

This entirely depends on how the C functions in your library are 
declared.
I don't know about your specific library but commonly the occurence 
of an

error is indicated by an integer return code, e.g. this might be the
signature of one of the functions in your library:

   int myfunction(void *interface, int argument)

If the documentation says that the return value (int) of this function
indicates an error, then you just need to get that return value back 
into

your Gambas program, which you accomplish by declaring the function in
Gambas as

   Extern myfunction(interface As Pointer, argument As Integer) As 
Integer


(notice the trailing "As Integer"). Then you can use "myfunction" in 
your
Gambas code like any other function and get and interpret its return 
value.


So, if this convention for error reporting is used, it is much 
simpler to

get information about errors, without using Alloc() and co. Your library
may use a different convention which actually involves pointers, but
I wouldn't know.

Regards,
Tobi

I should've said it in the beginning. Ofcourse any function returns 
integer value of 0 as success or -1 as error, but that only indicates 
that function was successfully executed or not. So GetStatus() will 
always return 0 because it shurely ran, nothing can go wrong here. But 
that's not the result I want. GetStatus() actually gives back a string 
with the status I asked for. Not that I fully understand how it does 
that. I already gave links to the libfptr.so library itself 
(http://allunix.ru/back/atol.tar.gz) and it's header files 
(http://allunix.ru/back/atol-header.tar.gz) so that it's clearer, what 
I'm talking about, unfortunately I am absolute zero in C to figure 
things out myself.


For example I can see that to get serial number of the device driven 
by that library i can use a function described like this:


get_SerialNumber(void *ptr, wchar_t *bfr, int bfrSize);

As far as I can tell what it does is it gets data needed and puts it 
into some buffer. The result of executing this function through 
put_SerialNumber(kkmDrv) will always be returned to me as 0.


So to see what's in that buffer, I have to then invoke 
GetStatus(kkmDrv) describe in .h file like GetStatus(void *ptr); and 
the integer result of this operation will also always be 0, which 
means that GetStatus itself ran successfully, but I don't care about 
that, I want to see what it actually told me, not that if it told me 
it successfully or not. So that's the main confusion. If all this is 
too complicated and lamely explained then nevermind, I expect it to be 

Re: [Gambas-user] Working with .so library

2017-06-15 Thread Tobias Boege
> All your help was very important for me, I now have completed my cash
> register software to the point where it does everything my company needs. I
> must say Gambas is a great language, it's very easy to learn from scratch,
> I'm surprised how obvious everything is. But there is a lot of work for me
> left to do mostly in terms of managing wrong human actions. My software
> works good if the employee doesn't do any mistakes, but that's unrealistic,
> so there's a lot of things I want to control and check. And that's where I'm
> stuck.
> 
> This library (which still calls itself a driver) theoretically is able to
> return a lot of values that I need, but I can't understand basic rules of
> how do we take output from a C-lib in Gambas.
> 
> From http://gambaswiki.org/wiki/howto/extern I understood that I need to
> locate a space in memory and pass a pointer to a library so that it can
> write data into that place in ram, which I would then read and set free.
> 
> So I have to declare a pointer, then Alloc(8) it, then pass it to my library
> and then read from it like it is a stream. Does this principle still work in
> current version of Gambas?
> 

If you do Alloc(8), then you get 8 bytes of memory. You most likely *don't*
want to read that like a stream, but use Integer@() or similar functions.

> What I don't understand is how I construct the code in my particular case.
> 
> To make an interface to the library I declare external pointer like this:
> 
> Extern CreateFptrInterface(ver As Integer) As Pointer
> 
> Then I declare some pointers that I'll use with help of the interface I
> created:
> 
> Extern put_DeviceEnable(p as Pointer, mode as Integer)
> 
> Extern GetStatus(p as Pointer, StatRequest as String)
> 
> Then I declare the pointer which will be that interface:
> 
> Public kkmDrv as Pointer
> 
> So then in sub I can do
> 
> kkmDrv = CreateFptrInterface(12) ' this establishes the interface
> 
> put_DeviceEnabled(kkmDrv, 1) ' this transfers the comand to the library
> through the interface.
> 
> And it works great.
> 
> But then If I want to get some data from the library, as I understand, I
> have to declare another pointer, allocate ram for it and pass my request.
> 
> I don't understand how should I pass that pointer to GetStatus() while also
> passing my interface pointer to it, let alone reading data back. Totally
> confused.
> 

This entirely depends on how the C functions in your library are declared.
I don't know about your specific library but commonly the occurence of an
error is indicated by an integer return code, e.g. this might be the
signature of one of the functions in your library:

  int myfunction(void *interface, int argument)

If the documentation says that the return value (int) of this function
indicates an error, then you just need to get that return value back into
your Gambas program, which you accomplish by declaring the function in
Gambas as

  Extern myfunction(interface As Pointer, argument As Integer) As Integer

(notice the trailing "As Integer"). Then you can use "myfunction" in your
Gambas code like any other function and get and interpret its return value.

So, if this convention for error reporting is used, it is much simpler to
get information about errors, without using Alloc() and co. Your library
may use a different convention which actually involves pointers, but
I wouldn't know.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

--
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user