Re: [Gambas-user] isNull()

2010-11-25 Thread Fabien Bodard
Le 25 novembre 2010 00:31, Benoît Minisini
gam...@users.sourceforge.net a écrit :
 I use IsNull extensively, is that going to be removed?

 richard


 No. I use it extensively too.

 Here is the result of my thought:

 - You can know the datatype of a variant with the TypeOf() function. You don't
 have to use the current Is() functions.

 - But you often need to know if a string can be converted to a number, an
 integer, a float, a date.

 - You normally want to know that for localized strings get from the outside
 (i.e. the user). For non-localized strings, they are intern to your program,
 so you should know what you are doing.

 So:

        IsNull(x) - kept its behaviour.
        IsInteger(x) - If Val(x) returns an integer
        IsFloat(x) - If Val(x) returns a float
        IsDate(x) - If Val(x) returns a date

hum ... isBinary ?

but how do you test if it's not ?

i imagine it is taht :

Function isFloat(Value as variant) as Float
dim fValue as Float

fValue = Val(Value)
if not error then return fValue


end


but in the other side i need to test it :/ again

if isFoat(Value) then print isFloat(Value)

in fact there is not fabulous soluce as we need two thing, known if a
convertion is possible with this datatype and then get the value.

the only one soluce i see is the C way... with a byref value

Function isFloat(Value as variant, Byref Ret as Float) as Boolean
dim fValue as Float

fValue = Val(Value)
if not error then
  Ret  = fValue
  Return True
endif

return

end

Dim fRet as Float

If IsFloat(Value, ByRef fRet) then Print fRet



 They should be enough. But I could add:

        IsLong(x) - If Val(x) returns a Long
        IsSingle(x) - If Single(x) returns a Single.

 Regards,

 --
 Benoît Minisini

 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user




-- 
Fabien Bodard

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] isNull()

2010-11-25 Thread Bruce Bruen
On Thu, 25 Nov 2010 10:01:42 am Benoît Minisini wrote:
  I use IsNull extensively, is that going to be removed?
  
  richard
 
 No. I use it extensively too.
 
 Here is the result of my thought:
 
 - You can know the datatype of a variant with the TypeOf() function. You
 don't have to use the current Is() functions.
 
 - But you often need to know if a string can be converted to a number, an
 integer, a float, a date.
 
 - You normally want to know that for localized strings get from the outside
 (i.e. the user). For non-localized strings, they are intern to your
 program, so you should know what you are doing.
 
 So:
 
   IsNull(x) - kept its behaviour.
   IsInteger(x) - If Val(x) returns an integer
   IsFloat(x) - If Val(x) returns a float
   IsDate(x) - If Val(x) returns a date
 
 They should be enough. But I could add:
 
   IsLong(x) - If Val(x) returns a Long
   IsSingle(x) - If Single(x) returns a Single.
 
 Regards,
Benoît,

I would like to see the generic IsNumber retained.  When dealing with external 
data sources, i.e. data from an external system source not a user the 
content of data fields in a database can vary widely over time. In different 
eras, a particular column may have it's type changed in the source database 
system but the existent data remains undisturbed.

Although it sounds weird, we often see data columns on mainframe and even on 
some PC based rdbms that have gone from a text (or char or varchar) to a 
numeric type, to a different numeric type and so forth.  In these database 
systems, any new inserts or updates will conform to the current type 
definition.  However, existing data is left as is.

So if booktype was originally char(1), then became charvar then became a 
specific structured datatype (for example, some of the custom types provided 
for in postgresql), we still see instances of, say A being returned by the 
dbms for booktype.  (The way we handle this is by way of our own postgresql 
front end database that accesses the remote dbms and returns text fields for 
any and all columns that contain suspect data types.)

In the main, I don't care if the field contains an integer or a float (or a 
long or single etc) just that it contains a number and not any non-numeric 
data.  I will worry about the representation after I have determined that it 
is a number.

I realise that this is a fairly arcane use of gambas, but the speed that we 
can develop (and run) filters based on this approach is why I chose gambas in 
the first place.  As I said, we use a 80-20 rule to get to the core issue of 
the data as soon as possible.  The parsing filters get more and more complex 
for each 20% left over.   So the ability to recognise generic datatypes in 
string values, is it a number, good, then return true else start looking for 
other clues as to what it is supposed to represent ... does it look like it 
might be a date? If so then try to decipher the date structure, else does it 
look like a known construct (i.e IF wkstr LIKE *(*%)* then ...) etc etc.


Oh, and by the way, I too use IsNull extensively, specifically to provide 
lazy loads of subordinate persisted objects, usually collections, whose 
content is not required unless specifically accessed.  For example, a Book 
object may have a property which is an Author object.  When the persisted 
book object is loaded from the database, the author object is not loaded until 
the program actually accesses the book.author property, viz

PRIVATE FUNCTION MyAuthor() as Author
if IsNull($myAuthor) 
$myAuthor=NEW Author
$myAuthor.LoadDB(ME.AuthorName)
endif
RETURN $myAuthor
END

(obviously simplified to exclude error checking).

-- 
best regards
Bruce Bruen

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] isNull()

2010-11-25 Thread Benoît Minisini
 On Thu, 25 Nov 2010 10:01:42 am Benoît Minisini wrote:
   I use IsNull extensively, is that going to be removed?
   
   richard
  
  No. I use it extensively too.
  
  Here is the result of my thought:
  
  - You can know the datatype of a variant with the TypeOf() function. You
  don't have to use the current Is() functions.
  
  - But you often need to know if a string can be converted to a number, an
  integer, a float, a date.
  
  - You normally want to know that for localized strings get from the
  outside (i.e. the user). For non-localized strings, they are intern to
  your program, so you should know what you are doing.
  
  So:
  IsNull(x) - kept its behaviour.
  IsInteger(x) - If Val(x) returns an integer
  IsFloat(x) - If Val(x) returns a float
  IsDate(x) - If Val(x) returns a date
  
  They should be enough. But I could add:
  IsLong(x) - If Val(x) returns a Long
  IsSingle(x) - If Single(x) returns a Single.
  
  Regards,
 
 Benoît,
 
 I would like to see the generic IsNumber retained.  When dealing with
 external data sources, i.e. data from an external system source not a
 user the content of data fields in a database can vary widely over time.
 In different eras, a particular column may have it's type changed in the
 source database system but the existent data remains undisturbed.
 
 Although it sounds weird, we often see data columns on mainframe and even
 on some PC based rdbms that have gone from a text (or char or varchar) to
 a numeric type, to a different numeric type and so forth.  In these
 database systems, any new inserts or updates will conform to the current
 type definition.  However, existing data is left as is.
 
 So if booktype was originally char(1), then became charvar then became a
 specific structured datatype (for example, some of the custom types
 provided for in postgresql), we still see instances of, say A being
 returned by the dbms for booktype.  (The way we handle this is by way of
 our own postgresql front end database that accesses the remote dbms and
 returns text fields for any and all columns that contain suspect data
 types.)
 
 In the main, I don't care if the field contains an integer or a float (or a
 long or single etc) just that it contains a number and not any non-numeric
 data.  I will worry about the representation after I have determined that
 it is a number.
 
 I realise that this is a fairly arcane use of gambas, but the speed that we
 can develop (and run) filters based on this approach is why I chose gambas
 in the first place.  As I said, we use a 80-20 rule to get to the core
 issue of the data as soon as possible.  The parsing filters get more and
 more complex for each 20% left over.   So the ability to recognise
 generic datatypes in string values, is it a number, good, then return
 true else start looking for other clues as to what it is supposed to
 represent ... does it look like it might be a date? If so then try to
 decipher the date structure, else does it look like a known construct
 (i.e IF wkstr LIKE *(*%)* then ...) etc etc.
 
 
 Oh, and by the way, I too use IsNull extensively, specifically to provide
 lazy loads of subordinate persisted objects, usually collections, whose
 content is not required unless specifically accessed.  For example, a
 Book object may have a property which is an Author object.  When the
 persisted book object is loaded from the database, the author object is
 not loaded until the program actually accesses the book.author property,
 viz
 
 PRIVATE FUNCTION MyAuthor() as Author
   if IsNull($myAuthor)
   $myAuthor=NEW Author
   $myAuthor.LoadDB(ME.AuthorName)
   endif
   RETURN $myAuthor
 END
 
 (obviously simplified to exclude error checking).

You must check the datatype of a column by using Result.Fields[xxx].Type, 
not by using Is() on the value. 

Or if really you don't want, use TypeOf().

Anyway, in my list, IsFloat() does what you want IsNumber() to do, as there is 
no number higher than Float in the Gambas number hierarchy.

Regards,

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Result object, again

2010-11-25 Thread Benoît Minisini
 2010/11/25 Benoît Minisini gam...@users.sourceforge.net:
  good evening all,
  i have another question about my eternal punishment: the result object
  :-)
  
  caveat answered to a former question about results in general:
   If you got into the habit of reading all the
   records you've selected into memory (or even if the Result object
   worked
   that way behind the scenes...), you'd soon find everything breaking
  with Out Of Memory errors as soon as you start doing anything
  serious.
  
  my question now is, how the result works behind the scenes, is there a
  counter (result.index?) that tells a layer (the driver?) which record is
  to be given back?
  
  regards,
  tobi
  
  A result object stores the entire query of the result in memory, because
  of the stupidity of most SQL backends.
 
 Postgresql definately supports cursors (being able to retrieve rows in
 groups and not hold them all in memory)
 
 Ian
 

Maybe all database backends have their specific way of not holding the full 
result in memory, I don't know. Anyway, all these SQL backends are stupid, 
that should be completely transparent.

Regards,

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Displaying Mouse.Wait while running a SHELL Command

2010-11-25 Thread Benoît Minisini
 I use
 
 INC Application.Busy
 
 and
 
 DEC Application.Busy
 
 in my applications on Debian Lenny (with LXDE)
 and Gambas 2.21 and it works just fine.
 
 Regards,
 Dimitris
 
 On Wed, Nov 24, 2010 at 9:23 PM, vikram austin...@yahoo.com wrote:
   Setting FMain.Mouse and calling WAIT is useless. Application.Busy
   should already set the busy cursor for every widget in the
   application.
  
  Otherwise
  
   this is a bug.
  
  Application.Busy alone is not showing a busy pointer on Debian Squeeze,
  with Gambas 2.21.
  
  Regards,
  Vikram
  
  

I see: with gb.gtk, Application.Busy  0 works only if the event loop is run 
just after (i.e. you call WAIT just after INC Application.Busy).

No idea why, I will look at that...

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Rnd Wiki

2010-11-25 Thread Demosthenes Koptsis
In wiki the page http://gambasdoc.org/help/lang/rnd?show

i think in these parts is hard read.

* If no parameters is specified, returns a pseudo-random number in the
  interval [ 0 , 1 [.
  * If the one parameter is specified, returns a pseudo-random in the
interval [ 0 , Min [.
  * If the two parameters are specified, returns a pseudo-random in the
interval [ Min , Max [.

I think you mean:

* If no parameters is specified the defaults are Min=0, Max=1, returns a
pseudo-random number in the
  interval [ 0 , 1 ]. 
  * If the one parameter is specified it is Max value, returns a
pseudo-random in the interval [ 0 , Max ].  
  * If the two parameters are specified they are Min, Max values,
returns a pseudo-random in the interval [ Min , Max ].

Am i right?

As i see in example that i understand.

-- 
Regards,
Demosthenes Koptsis.


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Rnd Wiki

2010-11-25 Thread Benoît Minisini
 In wiki the page http://gambasdoc.org/help/lang/rnd?show
 
 i think in these parts is hard read.
 
 * If no parameters is specified, returns a pseudo-random number in the
   interval [ 0 , 1 [.
   * If the one parameter is specified, returns a pseudo-random in the
 interval [ 0 , Min [.
   * If the two parameters are specified, returns a pseudo-random in the
 interval [ Min , Max [.
 
 I think you mean:
 
 * If no parameters is specified the defaults are Min=0, Max=1, returns a
 pseudo-random number in the
   interval [ 0 , 1 ].
   * If the one parameter is specified it is Max value, returns a
 pseudo-random in the interval [ 0 , Max ].
   * If the two parameters are specified they are Min, Max values,
 returns a pseudo-random in the interval [ Min , Max ].
 
 Am i right?
 
 As i see in example that i understand.

Yes, except that the higher born of the interval is never returned.

I have fixed the bad english in the wiki page.

Regards,

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Rnd Wiki

2010-11-25 Thread Demosthenes Koptsis
For one parameter you still have

* If only one parameter is specified, returns a pseudo-random in the
interval [ 0 , Min [.

i think is

* If only one parameter is specified, returns a pseudo-random in the
interval [ 0 , Max [.

and something else what does it mean 
0, Max [. 
?

isn't it [0, Max] ?

On Thu, 2010-11-25 at 13:10 +0100, Benoît Minisini wrote:
  In wiki the page http://gambasdoc.org/help/lang/rnd?show
  
  i think in these parts is hard read.
  
  * If no parameters is specified, returns a pseudo-random number in the
interval [ 0 , 1 [.
* If the one parameter is specified, returns a pseudo-random in the
  interval [ 0 , Min [.
* If the two parameters are specified, returns a pseudo-random in the
  interval [ Min , Max [.
  
  I think you mean:
  
  * If no parameters is specified the defaults are Min=0, Max=1, returns a
  pseudo-random number in the
interval [ 0 , 1 ].
* If the one parameter is specified it is Max value, returns a
  pseudo-random in the interval [ 0 , Max ].
* If the two parameters are specified they are Min, Max values,
  returns a pseudo-random in the interval [ Min , Max ].
  
  Am i right?
  
  As i see in example that i understand.
 
 Yes, except that the higher born of the interval is never returned.
 
 I have fixed the bad english in the wiki page.
 
 Regards,
 

-- 
Regards,
Demosthenes Koptsis.


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Rnd Wiki

2010-11-25 Thread Benoît Minisini
 For one parameter you still have
 
 * If only one parameter is specified, returns a pseudo-random in the
 interval [ 0 , Min [.
 
 i think is
 
 * If only one parameter is specified, returns a pseudo-random in the
 interval [ 0 , Max [.
 
 and something else what does it mean
 0, Max [.
 ?
 
 isn't it [0, Max] ?
 

No, as _Min_ is the first argument.

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Question about read/write file performance

2010-11-25 Thread Phạm Quang Dương
Hi,

Maybe this is a basic question. I have 2 scripts like this:

Code 1:
Dim buff as *Byte*
sizeOfFile = Stat(aBigFile).Size

hFile = Open aBigFile for read
For i = 1 to sizeOfFile
Read hFile, buff
Next
Close hFile

Code 2:
Dim buff as *Byte*
Dim bigBuff as *Float*

sizeOfFile = Stat(aBigFile).Size

hFile = Open aBigFile for read
For i = 1 to sizeOfFile / 8
Read hFile, bigBuff
 Next
For i = 1 to sizeOfFile MOD 8
Read hFile, buff
Next
Close hFile

Code 1 take t1 time unit to finish, code 2 is t2.

Are t1, t2 different? Which can be faster?
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Rnd Wiki

2010-11-25 Thread Fabien Bodard
if i wrote that like a function ...

rnd(min as float, max as float)

the variable named min don't change his name

i think benoit should take others name than min/max


val1/val2 ?

Float = Rnd ( [ Val1 [ , Val2 ] )


* If no parameters is specified, returns a pseudo-random number in the
  interval [ 0 , 1 [.

 * If only one parameter is specified it is Max value, returns a
pseudo-random in the
   interval [ 0 , Val1 [.

 * If the two parameters are specified they are Min, Max values,
   returns a pseudo-random in the interval [ Val1 , Val2 ].


--
Fabien Bodard

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Rnd Wiki

2010-11-25 Thread Demosthenes Koptsis
On Thu, 2010-11-25 at 14:26 +0100, Fabien Bodard wrote:
 if i wrote that like a function ...
 
 rnd(min as float, max as float)
 
 the variable named min don't change his name
 
 i think benoit should take others name than min/max

i am not confused about min, max, i understand that these are the lower
limit and upper limit of range min-max.

That's ok.

 
 val1/val2 ?
 
 Float = Rnd ( [ Val1 [ , Val2 ] )
 
 
 * If no parameters is specified, returns a pseudo-random number in the
   interval [ 0 , 1 [.
 
  * If only one parameter is specified it is Max value, returns a
 pseudo-random in the
interval [ 0 , Val1 [.

ok one paramater is the max value!

at this point i see in wiki this

If only one parameter is specified, returns a pseudo-random in the
interval [ 0 , Min [.


it confuses me that

[ 0 , Min [.


i understand it better as 

range
[0 - Max] or in your example range [0, Val2] not Val1.

Because the lower limit is Min=0 and upper limit is Max=Val2.

Example
' Between 0 and 2
PRINT Rnd(2)

Min=0, Max=2
Val1=0, Val2=2

it is equal

PRINT Rnd(0, 2)
Min=0, Max=2
Val1=0, Val2=2


  * If the two parameters are specified they are Min, Max values,
returns a pseudo-random in the interval [ Val1 , Val2 ].
 
 
 --
 Fabien Bodard
 
 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-- 
Regards,
Demosthenes Koptsis.


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] DateBox/DateChoose - numbers on calendar all the same

2010-11-25 Thread Ricardo Díaz Martín
I got the same problem with calendar control. Now I'm updating gambas3 from
svn. I'm going to try new version if the bug is fixed.

Regards,
Ricardo Díaz



2010/11/23 richard terry rte...@pacific.net.au

 Hi List

 ?Just my machine, but for some reason in my last update there all the days
 of
 the mont h are '31'

 any ideas?

 Richard


 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] DateBox/DateChoose - numbers on calendar all the same

2010-11-25 Thread Ricardo Díaz Martín
Works fine in 3321.

Regards,
Ricardo Díaz

2010/11/25 Ricardo Díaz Martín oceanosoftlapa...@gmail.com

 I got the same problem with calendar control. Now I'm updating gambas3 from
 svn. I'm going to try new version if the bug is fixed.

 Regards,
 Ricardo Díaz



 2010/11/23 richard terry rte...@pacific.net.au

 Hi List

 ?Just my machine, but for some reason in my last update there all the days
 of
 the mont h are '31'

 any ideas?

 Richard


 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Rnd Wiki

2010-11-25 Thread Demosthenes Koptsis
hm... i think i have got it.

The function accepts two parameters

Rnd ( [ Min [ , Max ] )

the Min param and the Max param.

if we pass only one param it takes as first argument, so it is the Min
argument

BUT BUT BUT... it uses it as Max value, as upper limit, because the
lower limit by default is 0 !!!

so the range is [0, Min] !!!
same to say the range is [0, Argument1]

Is that really happen ???

If this is the point it is really very strange to understand it for me
at least because suddenly the Min word became Max limit.



On Thu, 2010-11-25 at 14:26 +0100, Fabien Bodard wrote:
 if i wrote that like a function ...
 
 rnd(min as float, max as float)
 
 the variable named min don't change his name
 
 i think benoit should take others name than min/max
 
 
 val1/val2 ?
 
 Float = Rnd ( [ Val1 [ , Val2 ] )
 
 
 * If no parameters is specified, returns a pseudo-random number in the
   interval [ 0 , 1 [.
 
  * If only one parameter is specified it is Max value, returns a
 pseudo-random in the
interval [ 0 , Val1 [.
 
  * If the two parameters are specified they are Min, Max values,
returns a pseudo-random in the interval [ Val1 , Val2 ].
 
 
 --
 Fabien Bodard
 
 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-- 
Regards,
Demosthenes Koptsis.


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Rnd Wiki

2010-11-25 Thread Demosthenes Koptsis
I wrote something that i think describes better the Rnd().

If you like it you can use or modify it for the wiki.


Float = Rnd ( [ Min [ , Max ] )

Compute a pseudo-random floating point number between a lower Min limit
value and an upper Max limit value. 

# If no parameters is specified the default value for lower limit, Min, 
  is 0 and for upper limit, Max, is 1. 
  The function returns a pseudo-random number in the interval [ 0 , 1 ].

# If only one parameter is specified this parameter is used as the 
  upper limit, so argument1, Min will be used as upper limit. The  
  lower limit is by default 0. 
  The function returns a pseudo-random in the interval [ 0 , Min ].

# If both parameters are specified, Min is the lower limit and Max the
  upper limit.
  The function returns a pseudo-random in the interval [ Min , Max ]. 

Note that the higher born of the interval is never returned. 




On Thu, 2010-11-25 at 14:26 +0100, Fabien Bodard wrote:
 if i wrote that like a function ...
 
 rnd(min as float, max as float)
 
 the variable named min don't change his name
 
 i think benoit should take others name than min/max
 
 
 val1/val2 ?
 
 Float = Rnd ( [ Val1 [ , Val2 ] )
 
 
 * If no parameters is specified, returns a pseudo-random number in the
   interval [ 0 , 1 [.
 
  * If only one parameter is specified it is Max value, returns a
 pseudo-random in the
interval [ 0 , Val1 [.
 
  * If the two parameters are specified they are Min, Max values,
returns a pseudo-random in the interval [ Val1 , Val2 ].
 
 
 --
 Fabien Bodard
 
 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

-- 
Regards,
Demosthenes Koptsis.


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Fresh machine, fresh gambas - won't run

2010-11-25 Thread richard terry
Hi LIst

Any ideas on this.

Downloade fresh svn on fresh machine, compiled ok

When try and run gambas get message:

no project file in /usr/local/bin/gambas3

and nothing happens

Any help appreciated

richard

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Fresh machine, fresh gambas - won't run

2010-11-25 Thread Benoît Minisini
 Hi LIst
 
 Any ideas on this.
 
 Downloade fresh svn on fresh machine, compiled ok
 
 When try and run gambas get message:
 
 no project file in /usr/local/bin/gambas3
 
 and nothing happens
 
 Any help appreciated
 
 richard
 

Need more info! Full output of the compilation and installation process, 
distribution, and the contents of /usr/local/bin.

Regards,

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] DateBox/DateChoose - numbers on calendar all the same

2010-11-25 Thread richard terry
On Friday 26 November 2010 02:45:23 Ricardo Díaz Martín wrote:
seems fixed in the latest update

richard

 I got the same problem with calendar control. Now I'm updating gambas3 from
 svn. I'm going to try new version if the bug is fixed.
 
 Regards,
 Ricardo Díaz
 
 
 
 2010/11/23 richard terry rte...@pacific.net.au
 
  Hi List
 
  ?Just my machine, but for some reason in my last update there all the
  days of
  the mont h are '31'
 
  any ideas?
 
  Richard
 
 
  -
 - Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
  Tap into the largest installed PC base  get more eyes on your game by
  optimizing for Intel(R) Graphics Technology. Get started today with the
  Intel(R) Software Partner Program. Five $500 cash prizes are up for
  grabs. http://p.sf.net/sfu/intelisp-dev2dev
  ___
  Gambas-user mailing list
  Gambas-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/gambas-user
 
 ---
 --- Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
  Tap into the largest installed PC base  get more eyes on your game by
  optimizing for Intel(R) Graphics Technology. Get started today with the
  Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
  http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Primary Key missing?

2010-11-25 Thread Jorge Carrión
Try with sqliteman (Ubuntu repositories). It's a graphic environment good
enough for that operations...

For edit a record in terminal you have to use alter table command...

Good Luck.

2010/11/25 tobias tobiasb...@web.de

 hello,

 prooving my sqlite code, i have several buttons on a form, whose subs
 should do the same work in different ways (one just using Exec() method,
 the other does all work with the gambas objects (editing fields etc.)).

 after this code:

 Button2_Click:

   DIM hResult AS Result

   hConnection.Exec(create table test(id integer primary key, name
 varchar(10));)
   hConnection.Exec(insert into test(name) values(\Aaron\);)
   hConnection.Exec(insert into test(name) values('Zacharias');)

   '1|Aaron
   '2|Zacharias

 i have another button which should edit this table:

   DIM hResult AS Result

   hResult = hConnection.Edit(test, name=1, Aaron)
   hResult[name] = Adam
   hResult.Update()


 but in the line where the Edit()-function is used, i get the error that
 there is no primary key in my table but didn't i specify one creating
 the table?

 by the way... i found that i wasn't able to even find a command to edit
 a record in terminal; i wanted to proof if the sqlite3 program with the
 same commands would tell me the same...

 regards,
 tobi


 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Primary Key missing?

2010-11-25 Thread Benoît Minisini
 hello,
 
 prooving my sqlite code, i have several buttons on a form, whose subs
 should do the same work in different ways (one just using Exec() method,
 the other does all work with the gambas objects (editing fields etc.)).
 
 after this code:
 
 Button2_Click:
 
DIM hResult AS Result
 
hConnection.Exec(create table test(id integer primary key, name
 varchar(10));)
hConnection.Exec(insert into test(name) values(\Aaron\);)
hConnection.Exec(insert into test(name) values('Zacharias');)
 
'1|Aaron
'2|Zacharias
 
 i have another button which should edit this table:
 
DIM hResult AS Result
 
hResult = hConnection.Edit(test, name=1, Aaron)
hResult[name] = Adam
hResult.Update()
 
 
 but in the line where the Edit()-function is used, i get the error that
 there is no primary key in my table but didn't i specify one creating
 the table?
 
 by the way... i found that i wasn't able to even find a command to edit
 a record in terminal; i wanted to proof if the sqlite3 program with the
 same commands would tell me the same...
 
 regards,
 tobi
 

The syntax I know for sqlite is:

create table test(id integer, name varchar(10), primary key(id))

Try to create table by using the Table class, and not the Exec() method.

Otherwise, send me your sqlite database so that I look at it.

Regards,

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user