[Gambas-user] Database Results

2010-09-11 Thread tobias
hello mailing list,

i am absolutely new to databases in general and so to databases in 
gambas, too. i plan to use sqlite3 and in general i am understanding the 
related stuff part by part but it is very confusing with the different 
classes and i think this complicates my learning process.
but to my questions now. i want to make a database table just in memory 
to get me a bit closer to this all:

hConnection = NEW Connection
hConnection.Type = "sqlite3"
hConnection.Open()
hTable = hConnection.Tables.Add("test")
hTable.Fields.Add("id", db.Serial)
hTable.Fields.Add("name", db.String)
hTable.PrimaryKey = ["id"]
hTable.Update()
hResult = hConnection.Create("test")

and in the following i want to add three names to the database and then 
hResult.Update() them, but how do i create more records than one? (i 
used hResult["name"] = "tobi" to create the first, this works)

the next question.
i got a result from a database with some records predefined (fields are 
id (serial) and name (string)):

hResult = hConnection.Exec("select * from test")

in a for loop i go through all the records by doing:

FOR iCount = 0 TO hResult.Count - 1 STEP 1
  hResult.MoveTo(iCount)
  FOR EACH hField IN hResult.Fields
TextArea1.Insert(hResult[hField.Name])
  NEXT
  TextArea1.Insert("\n")
 NEXT

which works also fine but i really don't like the hResult.MoveTo() part 
of this code, isn't there any way to handle this result simply as an 
array? this would solve both problems and i could do database stuff with 
ease?

regards, tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Database Results

2010-09-11 Thread tobias
hi,

> For the first question I recomend to you use SQL sentence for insert. You
> can write a function where you past name of database table, name of fields
> and values and it returns the SQL INSERT sentence. I think it's all people
> do (me too!)
>
>
> SQL = "INSERT INTO test (id, name) VALUES ('1', 'name01')"
> hConnection.Exec(SQL)
>
> Regards,
> Ricardo Díaz
>
>
>
> 2010/9/11 Tobias Boege 
>
>   
>> hi,
>>
>> 
>>> like that ?
>>>
>>> For each hresult
>>>
>>>  print hResult!MyField
>>>
>>> next
>>>
>>>   
>> hmm, this works fine and looks like a pretty good solution! but there's no
>> way to handle a result the same way like an array? this FOR EACH construct
>> is especially for the result records? i need to understand this stuff for a
>> skilled labour completely, for this reason understanding the structure of
>> the Result-Object is neccessary. it seems to be the most complicated thing
>> in gambas :)
>>
>> and can you tell me something about my first problem? this also shouldn't
>> be so defficult, i think?
>>
>> regards, tobi
>> ___
>> WEB.DE DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für
>> nur 19,99 €/mtl.!* http://produkte.web.de/go/DSL-Doppel-Flatrate/2
>>
>>
>> --
>> Start uncovering the many advantages of virtual appliances
>> and start using them to simplify application deployment and
>> accelerate your shift to cloud computing
>> http://p.sf.net/sfu/novell-sfdev2dev
>> ___
>> Gambas-user mailing list
>> Gambas-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>> 
> --
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing
> http://p.sf.net/sfu/novell-sfdev2dev
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>   
okay, i'll do so too ;) in the picture database example there's a separate 
function, too, in which the table is opened for create and the one record 
created. this seems more
backend independent, but there's no need of it because i have to write about 
gamabs + sqlite3.

hmm, i hope anybody could tell me about the Result-Object structure, for the 
reason that i don't understand it, it would be very interesting in the skilled 
labour :)

thank you very much,
tobi


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Database Results

2010-09-12 Thread tobias
hi,

> The biggest help for him will be to read a sql book :)... it was for
> me the only way to quit the M$ ADO in the past. But gb.db and result
> is suffisely powerfull to manage most part of the db capabilities in a
> first time . Then he can learn sql do to more.
> 
> 
> All depend of the project ... for a little project with 10  to 1
> entry ... sqlite is good enouth. For more take a look to mysql or
> postgresql ... i'm agree with richard , postgre is powerfull ... (Both
> are good enouth for non professionnal in fact)
> 
> 2010/9/12 Caveat :
>> Hi Tobias
>>
>> I can understand your frustration, programming with databases is not so
>> simple in the beginning and there are some new concepts to get your head
>> around.  I think the Result object is quite often misunderstood and
>> people often ask:
>>
>> "Why can't the SQL stuff return something simple I can understand, like
>> an Array (or a Collection if you've gone a little further in Gambas), in
>> place of this complicated Result object?"
>>
>> Before answering these questions, it's probably a good idea to start
>> with an analogy, and hopefully by the time I'm done, you won't need the
>> answer you thought you needed.
>>
>> Let's imagine you've placed an ad for a job in the local paper and a few
>> people turn up for the interview.  No problem, you just ask everyone
>> into your little interview room, you go through the candidates and
>> choose one.
>>
>> Now let's imagine you've placed an ad for a job as a lady's underwear
>> salesman.  Suddenly you have thousands of applicants and they won't fit
>> into your little interview room (hint: memory!).  So you place your
>> thousands of applicants in the local sports hall (hint: database!) and
>> employ an assistant whose job it is to go and fetch the Next candidate
>> from the sports hall and bring them to your little interview room.  You
>> process each applicant in your little interview room and leave it to
>> your assistant (hint: Result!) to keep track of who you've already seen,
>> who's Next on the list, and to let you know when you've interviewed all
>> the candidates.
>>
>> I hope it's clear from this somewhat imperfect analogy that a Result
>> object doesn't hold all the records you've selected in memory and only
>> provides a mechanism for looking at each record matching your criteria
>> in turn.
>>
>> Databases are designed to hold huge numbers of records (think of the
>> government, a car manufacturer, a utility company...) often running into
>> the millions of records.  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.
>>
>> Now we've cleared all that up, let's look at just how simple the Result
>> object can be (we have a candidates table, with columns like name,
>> canReadAndWrite, address, date of birth etc.):
>>
>> Once you've established a Connection to your database, let's say in
>> myConn...
>>
>> Dim sql as String
>> Dim name as String
>> Dim canReadAndWrite as String
>> Dim candidateList as Result
>> sql = "select name, canReadAndWrite from candidates"
>> candidateList = myConn.Exec(sql)
>> ' This is the important line... see how simple it can be to navigate
>> round a Result object
>> FOR EACH candidateList
>>name = candidateList["name"]
>>canReadAndWrite = candidateList["canReadAndWrite"]
>>IF Ucase$(canReadAndWrite) = "YES" THEN
>>Print "Candidate " & name & " selected!"
>>ELSE
>>Print "Candidate " & name & " NOT selected!"
>>END IF
>> NEXT
>>
>> Ignoring all the obvious flaws in my example ("Why didn't you just add a
>> WHERE clause to preselect only the candidates who can read and write?",
>> "Why do you have a canReadAndWrite column in place of 2 separate canRead
>> and canWrite columns?", "Why isn't canReadAndWrite a boolean?") it does
>> hopefully serve to illustrate just how simple dealing with Result
>> objects can be:
>>
>> 1. You write your SQL statement String
>> 2. You assign your Result object to the return from myConn.E

Re: [Gambas-user] Database Results

2010-09-12 Thread tobias
hi,

another question about the databases and gambas to the developers:
how do i have to imagine exactly the interaction between the (sqlite) 
driver and my gambas program? what exactly is this 'driver'? is it just 
a kind of library? (sorry, i'm not so good at this level and i never had 
to do anything with drivers)

regards,
tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Database Results

2010-09-12 Thread tobias
hi,

> It's a kind of lbrary ... you select gb.db in thecomponents.
> 
> 
> then
> 
> private hcon as new connection
> 
> 
> Publc sub Main()
> 
>   hCon.type = "sqlite3"
>   hCon.Host=user.home &/ "dbpath"
>   hcon.Name = "mydatabase"
>   hcon.open
> 
> end
> 

yeah, so this 'kind of library' it loaded by the gambas component (?) 
loader and there are the several sqlite3 functionalities for my program?

regards,
tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Dim :: Another newbie question

2010-09-13 Thread tobias
hi,

> Hi again,
> 
> Local variables are declared with Dim, but, they need to be declared at 
> top of the Sub procedure?
> 
> Thanks
> 
> ___
> Lic. Daniel Quintero Rojas
> 
> http://www.dquinter.com.mx 
> ___
> --
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing
> http://p.sf.net/sfu/novell-sfdev2dev
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

well, yes just try it out ;)
i don't know the reason, but i think, it's the same because the gambas 
predefined classes are that dynamic that you shouldn't have to allocate 
them with a dynamic value, but if you really have to do that, you may 
use this function:
Pointer = Alloc ( Size AS Integer [ , Count AS Integer ] )
(see gambas documentation)

regards,
tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] someshort="xy" returns "Wanted short, got string instead"

2010-09-15 Thread tobias
hi,

> I can say, somebyte=ASC("x"), but is it possible to quickly assign a two-byte
> string to a typical two-byte short?
> 
> I'm sure this can be done with some lengthy function but (as most
> programmers should) I have a need for efficiency. I'm not concerned with
> character set mishaps for people with different language settings, as the
> app will be virtualized in a strict environment.
> 
> Also in general I am extremely interested in how to quickly assign values
> from one datatype to a different one. Does GAMBAS have a convention for this
> outside of functions like ASC?
> 
> -
> Kevin Fishburne, Eight Virtues
> www:  http://sales.eightvirtues.com http://sales.eightvirtues.com 
> e-mail:  mailto:sa...@eightvirtues.com sa...@eightvirtues.com 
> phone: (770) 853-6271

hum, this shouldn't be so diffcult and even if there were a function, it 
won't be more efficient than this one:

PUBLIC FUNCTION GetShort(sWord AS String) AS Short

RETURN Mid$(sWord, 1, 1) * 256 + Mid$(sWord, 2, 1)

END

i haven't tried it but i think it should work... but i think there is 
the problem that shorts in gambas are -32.768 <= Short <= +32.767 and i 
don't know if there's a possibility to make them unsigned like in c, but 
if you only want to deal with standard ascii chars (to 127) the highest 
value will be 127 * 256 + 127 = 32639 and this fits in the short's space.
i hope, this is all right.

regards,
tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] someshort="xy" returns "Wanted short, got string instead"

2010-09-15 Thread tobias
hi,

> hi,
> 
>> I can say, somebyte=ASC("x"), but is it possible to quickly assign a two-byte
>> string to a typical two-byte short?
>>
>> I'm sure this can be done with some lengthy function but (as most
>> programmers should) I have a need for efficiency. I'm not concerned with
>> character set mishaps for people with different language settings, as the
>> app will be virtualized in a strict environment.
>>
>> Also in general I am extremely interested in how to quickly assign values
>> from one datatype to a different one. Does GAMBAS have a convention for this
>> outside of functions like ASC?
>>
>> -
>> Kevin Fishburne, Eight Virtues
>> www:  http://sales.eightvirtues.com http://sales.eightvirtues.com 
>> e-mail:  mailto:sa...@eightvirtues.com sa...@eightvirtues.com 
>> phone: (770) 853-6271
> 
> hum, this shouldn't be so diffcult and even if there were a function, it 
> won't be more efficient than this one:
> 
> PUBLIC FUNCTION GetShort(sWord AS String) AS Short
> 
>   RETURN Mid$(sWord, 1, 1) * 256 + Mid$(sWord, 2, 1)
> 
> END
> 
> i haven't tried it but i think it should work... but i think there is 
> the problem that shorts in gambas are -32.768 <= Short <= +32.767 and i 
> don't know if there's a possibility to make them unsigned like in c, but 
> if you only want to deal with standard ascii chars (to 127) the highest 
> value will be 127 * 256 + 127 = 32639 and this fits in the short's space.
> i hope, this is all right.
> 
> regards,
> tobi
> 
> --
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

i forgot the asc() functions, of course:

PUBLIC FUNCTION GetShort(sWord AS String) AS Short

RETURN Asc(Mid$(sWord, 1, 1)) * 256 + Asc(Mid$(sWord, 2, 1))

END

or alternatively, you can assign the positions in the asc() function, like

RETURN Asc(sWord, 1) * 256 + Asc(sWord, 2)


 >> Also in general I am extremely interested in how to quickly assign 
values
 >> from one datatype to a different one. Does GAMBAS have a convention 
for this
 >> outside of functions like ASC?

strings that contain any format of numbers are converted to numbers of 
the adequate datatype by default when needed e.g. in function parameter 
passing and vice versa.
in the gambas doc (language index->conversion functions) you'll find 
that there are some common functions for everything

regards,
tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] someshort="xy" returns "Wanted short, got string instead"

2010-09-16 Thread tobias
hi,

> 
> tobias-47 wrote:
>> i forgot the asc() functions, of course:
>>
>> PUBLIC FUNCTION GetShort(sWord AS String) AS Short
>>
>>  RETURN Asc(Mid$(sWord, 1, 1)) * 256 + Asc(Mid$(sWord, 2, 1))
>>
>> END
>>
>> or alternatively, you can assign the positions in the asc() function, like
>>
>> RETURN Asc(sWord, 1) * 256 + Asc(sWord, 2)
>>
> 
> Thanks Tobi, I'll give that a try if it becomes the only option. Hopefully
> there's something I can do like a variable pointer, so the data can
> basically just be copied from the string directly. This is for a real-time
> game so any inefficiencies can cause it to "hang" for a second and interrupt
> the smoothness of play.
> 
> 
> Benoît Minisini wrote:
>>> I can say, somebyte=ASC("x"), but is it possible to quickly assign a
>>> two-byte string to a typical two-byte short?
>> It's a bad idea. What do you want to do exactly?
>>
> 
> Hi Benoît. Maybe there's a better way for me to have come to this point, but
> here's what's happening:
> 
> A server app retrieves sets of data from five binary files and stores them
> consecutively in a string. The first set is a 48x48 grid of shorts for a
> total of 4608 bytes (48x48x1x2). The last four sets are 48x48 grids of bytes
> for a total of 9216 bytes (48x48x4x1). So in total we have 13824 bytes (2304
> shorts and 9216 bytes), converted to one large string something like this:
> 
> DIM data AS String
> DIM chunk AS String
> 
> READ #somefileofshorts, chunk, 2
> data = data & chunk
> 
> READ #somefileofbytes, chunk, 1
> data = data & chunk
> 
> Normally I might read the shorts into an array of shorts, but in this case
> the final string is sent to a client app as a UDP packet. I also need to
> send all the data as a single packet rather than several. The client app
> receives the packet and parses it, assigning the floats and bytes of the
> payload to five 48x48 element arrays like this:
> 
> DIM somearray AS Short[48, 48]
> 
> somearray[x, y] =  Mid$(payload, position, 2)
> 
> It needs to make that string to short conversion 2304 times (48x48) in as
> little time as possible.
> 
> I can only think of two solutions here. One is to find a way to convert a
> two-character string to a short as quickly as possible (the subject of the
> post), and the other is to change the way I'm collecting the data to be sent
> as a UDP packet so that it can be read more "normally" by the client. The
> UDP_Read procedure is generic however, and has no way of knowing what kind
> of data is contained within the packet, so that may be difficult at best.
> 
> -
> Kevin Fishburne, Eight Virtues
> www:  http://sales.eightvirtues.com http://sales.eightvirtues.com 
> e-mail:  mailto:sa...@eightvirtues.com sa...@eightvirtues.com 
> phone: (770) 853-6271

oh, hum, first: why am i "tobi-47"? :D
well, i searched the web and the doc and the only thing i found related 
to this was the function VarPtr() in the language index which should 
return a pointer to the given variable but for the reason that this 
function is declared as a gambas3 function it wasn't possible for me to 
test it and there seems to be a limitation for strings...
the c++ ways to get a memory address don't work, too, with gambas 
strings (&s is stupid in gambas and s[0] returns "not an object")
sorry...

regards,
tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] ME.Height and Menus

2010-09-27 Thread tobias
Good evening,

i never had to use menues in my programs, but now i have to reproduce a 
program written in delphi for our ubuntu computers at school, only for 
education purposes (the program was also written by students, don't 
worry ;)). this program has a menue and a simple textarea just under it 
and i want to arrange the contents dynamically using the Form_Resize() 
event. if i do TextArea1.Move(0, 0, ME.Width, ME.Heigth), the textarea 
is just a bit too big for the form and this doesn't look very well. if i 
set the menue to unvisible, all works properly. i now thought that i 
just can PRINT ME.Height; " "; TextArea1.Height
and look up the difference to get the menue's height as a constant but 
they are equal, so what's wrong with it?

regards,
tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Is it possible to create .DEB packages from Fedora?

2010-09-29 Thread tobias
hi,

> I'd like to move to Fedora, but I won't do it without knowing whether I'll
> be able to create gambas2 project packages for Debian based distributions.
> Is it solved in Fedora?
> 
> Thanks!
> 
> Csaba

well, i use ubuntu and if i click on "make installation package", next 
to executable tool button, a .deb is created after some steps.

regards,
tobi

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Question about some simple code enterin' data

2010-10-14 Thread tobias
pira...@mail.com schrieb:
> Hi everyone.
> I need to enter numeric data into a previously formatted text field.
> The format is 99-99-9, where 9s are any number.
> I need to display just  the scores so the operator just enters the 
> numbers.
> Please help!!
> Thanks in advance.
> Pablo.
> 
> --
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
hi,
i think you want make one single textbox to display some sections of 
numbers e.g. like a serial numbern, with some - between the sections?? 
or what do you mean?
if this is the case, you may implement a TextBox_KeyPress() event to 
handle each keypress and if one section is complete, insert your 
separator (e.g. "-"), this way you also may prevent the insertion of 
chars which shouldn't be part of the pattern.

regards,
tobi

--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Question about some simple code enterin' data

2010-10-15 Thread tobias
pira...@mail.com schrieb:
> Thanks Tobi for your quick reply.
> With TextBox_KeyPress() I manage the insertion of numbers. But I need 
> to display both scores before the data entry.
> The example you gave me with the serial numbers is exactly what I need.
> Let's say -as another posibility- that I'd like to enter a date in a 
> format "mm/dd/"... I need to show both slashes before entering data 
> and, while typing numbers, I need to move between characters 
> automatically.
> I'd like some code as an example just to figure out howto manage it.
> Hope to be clear  with my explanation.
> Thanks again.
> Wait 4Ur answer.
> Pablo.
> 
> 
> 
> -Original Message-
> From: tobias 
> To: mailing list for gambas users 
> Sent: Thu, Oct 14, 2010 3:51 pm
> Subject: Re: [Gambas-user] Question about some simple code enterin' data
> 
> 
> pira...@mail.com schrieb:
>> Hi everyone.
>> I need to enter numeric data into a previously formatted text field.
>> The format is 99-99-9, where 9s are any number.
>> I need to display just  the scores so the operator just enters the
>> numbers.
>> Please help!!
>> Thanks in advance.
>> Pablo.
>>
>>
> -
> -
>> Beautiful is writing same markup. Internet Explorer 9 supports
>> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
>> Spend less time writing and  rewriting code and more time creating 
> great
>> experiences on the web. Be a part of the beta today.
>> http://p.sf.net/sfu/beautyoftheweb
>> ___
>> Gambas-user mailing list
>> Gambas-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
> hi,
> i think you want make one single textbox to display some sections of
> numbers e.g. like a serial numbern, with some - between the sections??
> or what do you mean?
> if this is the case, you may implement a TextBox_KeyPress() event to
> handle each keypress and if one section is complete, insert your
> separator (e.g. "-"), this way you also may prevent the insertion of
> chars which shouldn't be part of the pattern.
> 
> regards,
> tobi
> 
> -
> -
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
>   
> 
> --
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
hi,
ok, my english is not as good as it should be^^ (i don't know what you 
mean with "I need to move between characters
automatically." and "But I need
to display both scores before the data entry.")

but if i understood, you  want to have the slashes in the clear textbox 
and if one section is complete automatically jump behind the slash?

--
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Question about some simple code enterin' data

2010-10-15 Thread tobias

pira...@mail.com schrieb:

EXACTLY
EXACTO
That's what I need.
The function is called input mask. I could not find it in Gambas.



-Original Message-
From: tobias 
To: mailing list for gambas users 
Sent: Fri, Oct 15, 2010 9:26 am
Subject: Re: [Gambas-user] Question about some simple code enterin' data


pira...@mail.com schrieb:

Thanks Tobi for your quick reply.
With TextBox_KeyPress() I manage the insertion of numbers. But I need
to display both scores before the data entry.
The example you gave me with the serial numbers is exactly what I 

need.

Let's say -as another posibility- that I'd like to enter a date in a
format "mm/dd/"... I need to show both slashes before entering 

data

and, while typing numbers, I need to move between characters
automatically.
I'd like some code as an example just to figure out howto manage it.
Hope to be clear  with my explanation.
Thanks again.
Wait 4Ur answer.
Pablo.



-Original Message-
From: tobias 
To: mailing list for gambas users 
Sent: Thu, Oct 14, 2010 3:51 pm
Subject: Re: [Gambas-user] Question about some simple code enterin' 

data


pira...@mail.com schrieb:

Hi everyone.
I need to enter numeric data into a previously formatted text field.
The format is 99-99-9, where 9s are any number.
I need to display just  the scores so the operator just enters the
numbers.
Please help!!
Thanks in advance.
Pablo.



-


-

Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating

great

experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

hi,
i think you want make one single textbox to display some sections of
numbers e.g. like a serial numbern, with some - between the sections??
or what do you mean?
if this is the case, you may implement a TextBox_KeyPress() event to
handle each keypress and if one section is complete, insert your
separator (e.g. "-"), this way you also may prevent the insertion of
chars which shouldn't be part of the pattern.

regards,
tobi



-


-
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating 

great

experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user





-
-

Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating 

great

experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

hi,
ok, my english is not as good as it should be^^ (i don't know what you
mean with "I need to move between characters
automatically." and "But I need
to display both scores before the data entry.")

but if i understood, you  want to have the slashes in the clear textbox
and if one section is complete automatically jump behind the slash?

-
-
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that 
run

across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

  


--
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run

across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
well, during writing a

[Gambas-user] SQLite Driver

2010-11-02 Thread tobias
good evening,
i have a simple question.
in the doc it is said that "The SQLite driver supports the version 3 of 
SQLite, and falls back to the version 2 driver if needed. See 
www.sqlite.org for more information. "
first, i can't find these "more information"...
and i what could be reasons for the driver to "fall back to version 2"? 
syntax issues? or only by
Connection.Type = "sqlite2"?

regards,
tobi

--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] SQLite memory database

2010-11-03 Thread tobias
good evening,
i have a more sqlite related question:
what does it mean in the doc: For SQLite, you can also create and use a 
database in memory by giving as database name the string ":memory:". 
(from gambas2 doc, gb.db.connection.name)

what is creating a database in memory?? simply a temporary database or 
is that a special term used with sqlite??
what is the difference (with Connection.Type = "sqlite3") between
Connection.Name = "" (which means /tmp/sqlite.db)
and
Connection.Name = ":memory:"??
just that there is a temporary file in the first case and in the second 
everything is done in memory??

--
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware, 
phishing sites, and compromised hosts - saving your company time, 
money, and embarrassment.   Learn More! 
http://p.sf.net/sfu/hpdev2dev-nov
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] SQLite memory database

2010-11-03 Thread tobias
tobias schrieb:
> good evening,
> i have a more sqlite related question:
> what does it mean in the doc: For SQLite, you can also create and use a 
> database in memory by giving as database name the string ":memory:". 
> (from gambas2 doc, gb.db.connection.name)
> 
> what is creating a database in memory?? simply a temporary database or 
> is that a special term used with sqlite??
> what is the difference (with Connection.Type = "sqlite3") between
> Connection.Name = "" (which means /tmp/sqlite.db)
> and
> Connection.Name = ":memory:"??
> just that there is a temporary file in the first case and in the second 
> everything is done in memory??
> 
> --
> Achieve Improved Network Security with IP and DNS Reputation.
> Defend against bad network traffic, including botnets, malware, 
> phishing sites, and compromised hosts - saving your company time, 
> money, and embarrassment.   Learn More! 
> http://p.sf.net/sfu/hpdev2dev-nov
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

ok, i found the information at sqlite.com

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] SQL Transaction

2010-11-03 Thread tobias
hi,
i have another sql related question: what are the benefits of using a 
transaction instead of ... using it not?

regards, tobi

--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Result object

2010-11-15 Thread tobias
hi,
i have again another question about the result object...
when i do:
hResult = hConnection.Edit("table")

i get a read/write result, i can move through the elements and edit 
their fields, e.g.
hResult.MoveTo(2)
hResult["id"] = 10

right?
but where do i have to move to to add one (or more) new element/s??

--
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Result object

2010-11-16 Thread tobias
Charlie Reinl schrieb:
> Am Montag, den 15.11.2010, 19:56 +0100 schrieb tobias:
>> hi,
>> i have again another question about the result object...
>> when i do:
>> hResult = hConnection.Edit("table")
>>
>> i get a read/write result, i can move through the elements and edit 
>> their fields, e.g.
>> hResult.MoveTo(2)
>> hResult["id"] = 10
>>
>> right?
>> but where do i have to move to to add one (or more) new element/s??
>>
> Salut Tobias,
> 
> hResult = hConnection.Create("table")
> 
> should to the job
> 
this maybe works but in theory i can't imagine why...?

--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Result object

2010-11-17 Thread tobias
Charlie Reinl schrieb:
> Am Dienstag, den 16.11.2010, 21:44 +0100 schrieb tobias:
>> Charlie Reinl schrieb:
>>> Am Montag, den 15.11.2010, 19:56 +0100 schrieb tobias:
>>>> hi,
>>>> i have again another question about the result object...
>>>> when i do:
>>>> hResult = hConnection.Edit("table")
>>>>
>>>> i get a read/write result, i can move through the elements and edit 
>>>> their fields, e.g.
>>>> hResult.MoveTo(2)
>>>> hResult["id"] = 10
>>>>
>>>> right?
>>>> but where do i have to move to to add one (or more) new element/s??
>>>>
>>> Salut Tobias,
>>>
>>> hResult = hConnection.Create("table")
>>>
>>> should to the job
>>>
>> this maybe works but in theory i can't imagine why...?
>>
> Sorry, I can't follow you.
> 
> EDIT reads something which can be handeled read/write afterwards.
> 
> Where is the problem with CREATE  ?
> 
> CREATE, creates something new, and throws immediately an EDIT.
> 
> So, EDIT reads something which can be handeled read/write afterwards. 
> 
salut,
yes, understood is this far but my problem is that hConnection.Edit() 
returns a read/write result to edit an specific entry field by 
Move*()ing to the record. my question is now where i have to Move*() to 
to add a new record.
Connection.Create("table")["field"] = new_records_value
works well, but in case i Move*()ed somewhere in the result where do i 
have to move to make sure that i don't overwrite data in the record i 
just moved too, instead create a new one?
is this explanation clear enough?

--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Result object

2010-11-17 Thread tobias
Charlie Reinl schrieb:
> Am Dienstag, den 16.11.2010, 21:44 +0100 schrieb tobias:
>> Charlie Reinl schrieb:
>>> Am Montag, den 15.11.2010, 19:56 +0100 schrieb tobias:
>>>> hi,
>>>> i have again another question about the result object...
>>>> when i do:
>>>> hResult = hConnection.Edit("table")
>>>>
>>>> i get a read/write result, i can move through the elements and edit 
>>>> their fields, e.g.
>>>> hResult.MoveTo(2)
>>>> hResult["id"] = 10
>>>>
>>>> right?
>>>> but where do i have to move to to add one (or more) new element/s??
>>>>
>>> Salut Tobias,
>>>
>>> hResult = hConnection.Create("table")
>>>
>>> should to the job
>>>
>> this maybe works but in theory i can't imagine why...?
>>
> Sorry, I can't follow you.
> 
> EDIT reads something which can be handeled read/write afterwards.
> 
> Where is the problem with CREATE  ?
> 
> CREATE, creates something new, and throws immediately an EDIT.
> 
> So, EDIT reads something which can be handeled read/write afterwards. 
> 
oh, i'm very sorry, i just read the gambas doc entry entirely, 
Connection.Create() creates a read/write result for creating records, i 
thought it would create a new table an returns an empty result-.-
hmm, but a new question: to add 2 new records, do i have to call 
Connection.Create() twice? or is there an easier way??

--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Result object

2010-11-17 Thread tobias
Benoît Minisini schrieb:
>> Charlie Reinl schrieb:
>>> Am Dienstag, den 16.11.2010, 21:44 +0100 schrieb tobias:
>>>> Charlie Reinl schrieb:
>>>>> Am Montag, den 15.11.2010, 19:56 +0100 schrieb tobias:
>>>>>> hi,
>>>>>> i have again another question about the result object...
>>>>>> when i do:
>>>>>> hResult = hConnection.Edit("table")
>>>>>>
>>>>>> i get a read/write result, i can move through the elements and edit
>>>>>> their fields, e.g.
>>>>>> hResult.MoveTo(2)
>>>>>> hResult["id"] = 10
>>>>>>
>>>>>> right?
>>>>>> but where do i have to move to to add one (or more) new element/s??
>>>>> Salut Tobias,
>>>>>
>>>>> hResult = hConnection.Create("table")
>>>>>
>>>>> should to the job
>>>> this maybe works but in theory i can't imagine why...?
>>> Sorry, I can't follow you.
>>>
>>> EDIT reads something which can be handeled read/write afterwards.
>>>
>>> Where is the problem with CREATE  ?
>>>
>>> CREATE, creates something new, and throws immediately an EDIT.
>>>
>>> So, EDIT reads something which can be handeled read/write afterwards.
>> oh, i'm very sorry, i just read the gambas doc entry entirely,
>> Connection.Create() creates a read/write result for creating records, i
>> thought it would create a new table an returns an empty result-.-
>> hmm, but a new question: to add 2 new records, do i have to call
>> Connection.Create() twice? or is there an easier way??
>>
> 
> Once you have call the Update() method on the Result object, you can use it 
> again to create another record.
> 
> Regards,
> 
so i have to .Create(), input, .Update(), .Create(), input and .Update()?
not .Create(), input, .Update(), input, .Update()?

thank you for your help!

--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Result object, again

2010-11-24 Thread tobias
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

--
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 tobias
Benoît Minisini schrieb:
>> 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.
> 
> The gb.db.form implements a system that only keep a small part of the query 
> result, by using the ">" operator on the table key, "Order By", and the 
> Limit() method. That way, you can use a DataBrowser to browse a table that is 
> located on a far server easily.
> 
> Regards,
> 
thank you!
but at the moment, i don't think about the db related controls...
ok, so the result stores just the query in memory and on demand, it 
loads the next (according to Result.Index) result entry, right? is there 
another internal pointer?
i hopefully finish my research paper (dict.cc told me that this is a 
good word for it :-) ) the next days, i think, it would be found then 
somewhere at gambas-club.de or gambas-projekt.de ...

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


[Gambas-user] Primary Key missing?

2010-11-25 Thread tobias
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


Re: [Gambas-user] Primary Key missing?

2010-11-26 Thread tobias
hi,

> So I'm wondering whether your Edit might not work better if you were to
> try:
> 
> hResult = hConnection.Edit("test", "id=&1", 1)
> hResult["name"] = "Adam"
> hResult.Update
> hResult.Commit
> 
> 

this gives the same error, i changed the tables creation to

hConnection.Exec("create table test(id integer, name varchar(10), 
primary key(id));")

but nothing happens...?
in terminal everything went well, even with
create table test(id integer primary key, name varchar(10));

--
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-27 Thread tobias
Benoît Minisini schrieb:
>> hi,
>>
>>> So I'm wondering whether your Edit might not work better if you were to
>>>
>>> try:
>>> hResult = hConnection.Edit("test", "id=&1", 1)
>>> hResult["name"] = "Adam"
>>> hResult.Update
>>> hResult.Commit
>> this gives the same error, i changed the tables creation to
>>
>> hConnection.Exec("create table test(id integer, name varchar(10),
>> primary key(id));")
>>
>> but nothing happens...?
>> in terminal everything went well, even with
>> create table test(id integer primary key, name varchar(10));
>>
> 
> Which version of Gambas do you use?
> 
gambas2.20 (i thought, it would be 2.21...?)

--
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-28 Thread tobias
>>> hi,
>>>
 So I'm wondering whether your Edit might not work better if you were to

 try:
 hResult = hConnection.Edit("test", "id=&1", 1)
 hResult["name"] = "Adam"
 hResult.Update
 hResult.Commit
>>> this gives the same error, i changed the tables creation to
>>>
>>> hConnection.Exec("create table test(id integer, name varchar(10),
>>> primary key(id));")
>>>
>>> but nothing happens...?
>>> in terminal everything went well, even with
>>> create table test(id integer primary key, name varchar(10));
>>>
>> Which version of Gambas do you use?
>>
> gambas2.20 (i thought, it would be 2.21...?)
> 
> --
> 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
i don't know, if i said it but the regular way (with gambas objects and 
setting Table.PrimaryKey = ["id"]) worked fine... i don't know... i've 
just been trying to install gambas2-2.22 but tar sais the archive is 
broken and my download speed decreased to nearly 0 -.-

--
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] Connection.Create and .Index

2010-11-29 Thread tobias
hi,

i'm confused about the output i get from:

PUBLIC SUB test()

   DIM hResult AS Result

   'hConnection is an established Connection, with existing Table 
"test", Fields "id", db.Serial Primary Key, "name" db.String
   hResult = hConnection.Create("test")
   PRINT hResult.Index
   hResult["name"] = "Aaron"
   hResult.Update()
   PRINT hResult.Index
   hResult["name"] = "Zacharias"
   hResult.Update()

END

i get in console:
0
0

but i thought the second PRINTed Index should be 1? the records are fine 
but with both indizes 0 shouldn't the first be overwritten with 
"Zacharias" or is there another internal pointer to specify the record??

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


Re: [Gambas-user] Connection.Create and .Index

2010-11-29 Thread tobias
Benoît Minisini schrieb:
>> hi,
>>
>> i'm confused about the output i get from:
>>
>> PUBLIC SUB test()
>>
>>DIM hResult AS Result
>>
>>'hConnection is an established Connection, with existing Table
>> "test", Fields "id", db.Serial Primary Key, "name" db.String
>>hResult = hConnection.Create("test")
>>PRINT hResult.Index
>>hResult["name"] = "Aaron"
>>hResult.Update()
>>PRINT hResult.Index
>>hResult["name"] = "Zacharias"
>>hResult.Update()
>>
>> END
>>
>> i get in console:
>> 0
>> 0
>>
>> but i thought the second PRINTed Index should be 1? the records are fine
>> but with both indizes 0 shouldn't the first be overwritten with
>> "Zacharias" or is there another internal pointer to specify the record??
>>
>> regards,
>> tobi
>>
> 
> In creation mode there is only one record in the Result object, the record 
> that will be created. So Result.Index always returns 0.
> 
> Regards,
> 
oh... of course! this makes sense!
and for general unterstanding, i can say that an index in a result is 
some kind of linked to a position in the database so that the driver, or 
whatever does this, knows, where to write the record in the result to in 
the real database?

--
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] Connection.Create and .Index

2010-11-29 Thread tobias
Benoît Minisini schrieb:
>>> In creation mode there is only one record in the Result object, the
>>> record that will be created. So Result.Index always returns 0.
>>>
>>> Regards,
>> oh... of course! this makes sense!
>> and for general unterstanding, i can say that an index in a result is
>> some kind of linked to a position in the database so that the driver, or
>> whatever does this, knows, where to write the record in the result to in
>> the real database?
>>
> 
> Not at all. It's just the index inside the internal record buffer of the 
> Result object.
> 
so how does the driver know where to write a result record to in a database?

thanks,
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


Re: [Gambas-user] Connection.Create and .Index

2010-11-30 Thread tobias
Benoît Minisini schrieb:
>> so how does the driver know where to write a result record to in a
>> database?
>>
>> thanks,
>> tobi
>>
> 
> Well, do you know what SQL is?
> 

i know that it is a query language to manipulate data in databases, but 
that doesn't seem to be enough if you can answer my question with the 
definition of sql :-)

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


Re: [Gambas-user] Connection.Create and .Index

2010-11-30 Thread tobias
Benoît Minisini schrieb:
>> Benoît Minisini schrieb:
 so how does the driver know where to write a result record to in a
 database?

 thanks,
 tobi
>>> Well, do you know what SQL is?
>> i know that it is a query language to manipulate data in databases, but
>> that doesn't seem to be enough if you can answer my question with the
>> definition of sql :-)
>>
>> regards,
>> tobi
>>
> 
> Gambas database drivers communicates with the client libraries mainly by 
> using 
> SQL statements. They do not know where to write a result in the database. 
> 
> But they need to identify a record to modify it, and the only standard way is 
> having a primary key in the table. With no primary key, you can't use the 
> Edit() method.
> 
> Regards,
> 

...as i just saw testing my code :-)
i thought this works this way but i wasn't sure...

thank you!

--
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] Connection.Tables

2010-12-05 Thread tobias
hi,
i noticed something in my test with Connection.Edit() (sqlite3):
i created a table with connection.exec()

hConnection.Exec("create table test(id integer primary key, name
varchar(10));")

then inserted some data
hConnection.Exec("insert into test(name) values(\"Aaron\");")
hConnection.Exec("insert into test(name) values('Zacharias');")

now, because i thought, this is the only way to prevent the error "table
test has no primary key", i set the primary key property of the table
object:
hConnection.Tables["test"].PrimaryKey = ["id"]

not this brought me "Read-only property".
is this because i created the table via exec() and there is no
synchronization (possible)?

regards,
tobi


--
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Connection.Tables

2010-12-05 Thread tobias
Benoît Minisini schrieb:
>> hi,
>> i noticed something in my test with Connection.Edit() (sqlite3):
>> i created a table with connection.exec()
>>
>> hConnection.Exec("create table test(id integer primary key, name
>> varchar(10));")
>>
>> then inserted some data
>> hConnection.Exec("insert into test(name) values(\"Aaron\");")
>> hConnection.Exec("insert into test(name) values('Zacharias');")
>>
>> now, because i thought, this is the only way to prevent the error "table
>> test has no primary key", i set the primary key property of the table
>> object:
>> hConnection.Tables["test"].PrimaryKey = ["id"]
>>
>> not this brought me "Read-only property".
>> is this because i created the table via exec() and there is no
>> synchronization (possible)?
>>
>> regards,
>> tobi
>>
> 
> You can't update the primary index of a table once it has been created anyway.
> 
> I have understood where the bug with primary key comes from. It is just a 
> matter of case: write "integer" in upper case, and the database driver will 
> detect the primary key!
> 
> To understand all that, you must be aware that SQLite is a non-typed 
> database, 
> i.e. the field datatypes given in the CREATE TABLE statement are mostly 
> ignored. A SQLite field can hold any datatype, whatever its definition!
> 
> "Mostly", because there is a big exception: if you declare a field as 
> "integer 
> primary key", you actually declare a 64 bits integer-only field that will 
> increment automatically as each record creation. And this special primary key 
> does not appear in the index list returned by SQLite (because it is actually 
> an index present in each table, named "rowid").
> 
> See http://www.sqlite.org/lang_createtable.html for more information.
> 
> To detect it, I added a test on the table SQL declaration: if I don't see any 
> index in the table, and if the table has an integer field, I assume it is the 
> primary key. 
> 
> The test is not perfect yet (a table could have an "integer" field and no 
> primary key), but, more important, it was buggy, as it assumed that "integer" 
> was written in upper case!
> 
> I will fix that in the next revision, and your "id integer primary key" will 
> be correctly detected as the primary key of the table.
> 
> Note that if you create your table by using the Gambas interface, and not by 
> sending "CREATE TABLE" statements directly, you won't have the problem, 
> because Gambas only uses "integer" when creating an autoincrement integer 
> field. For all other integer fields, it uses "INT4".
> 
> Regards,
> 
oh, thank you very very much. this will correct all my problems. of 
course, i use the gambas interface in serious programs but this method 
exists too and i try my best to document and discover everything ;-)

thank you,
tobi

--
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Connection.Tables

2010-12-05 Thread tobias

>> You can't update the primary index of a table once it has been created 
>> anyway.
>>
>> I have understood where the bug with primary key comes from. It is just a 
>> matter of case: write "integer" in upper case, and the database driver will 
>> detect the primary key!
>>
>> To understand all that, you must be aware that SQLite is a non-typed 
>> database, 
>> i.e. the field datatypes given in the CREATE TABLE statement are mostly 
>> ignored. A SQLite field can hold any datatype, whatever its definition!
>>
>> "Mostly", because there is a big exception: if you declare a field as 
>> "integer 
>> primary key", you actually declare a 64 bits integer-only field that will 
>> increment automatically as each record creation. And this special primary 
>> key 
>> does not appear in the index list returned by SQLite (because it is actually 
>> an index present in each table, named "rowid").
>>
>> See http://www.sqlite.org/lang_createtable.html for more information.
>>
>> To detect it, I added a test on the table SQL declaration: if I don't see 
>> any 
>> index in the table, and if the table has an integer field, I assume it is 
>> the 
>> primary key. 
>>
>> The test is not perfect yet (a table could have an "integer" field and no 
>> primary key), but, more important, it was buggy, as it assumed that 
>> "integer" 
>> was written in upper case!
>>
>> I will fix that in the next revision, and your "id integer primary key" will 
>> be correctly detected as the primary key of the table.
>>
>> Note that if you create your table by using the Gambas interface, and not by 
>> sending "CREATE TABLE" statements directly, you won't have the problem, 
>> because Gambas only uses "integer" when creating an autoincrement integer 
>> field. For all other integer fields, it uses "INT4".
>>
>> Regards,
>>

to be correct, that revision is this about? i couldn't find it in the ide?

--
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Connection.Tables

2010-12-05 Thread tobias
Benoît Minisini schrieb:
 You can't update the primary index of a table once it has been created
 anyway.

 I have understood where the bug with primary key comes from. It is just
 a matter of case: write "integer" in upper case, and the database
 driver will detect the primary key!

 To understand all that, you must be aware that SQLite is a non-typed
 database, i.e. the field datatypes given in the CREATE TABLE statement
 are mostly ignored. A SQLite field can hold any datatype, whatever its
 definition!

 "Mostly", because there is a big exception: if you declare a field as
 "integer primary key", you actually declare a 64 bits integer-only
 field that will increment automatically as each record creation. And
 this special primary key does not appear in the index list returned by
 SQLite (because it is actually an index present in each table, named
 "rowid").

 See http://www.sqlite.org/lang_createtable.html for more information.

 To detect it, I added a test on the table SQL declaration: if I don't
 see any index in the table, and if the table has an integer field, I
 assume it is the primary key.

 The test is not perfect yet (a table could have an "integer" field and
 no primary key), but, more important, it was buggy, as it assumed that
 "integer" was written in upper case!

 I will fix that in the next revision, and your "id integer primary key"
 will be correctly detected as the primary key of the table.

 Note that if you create your table by using the Gambas interface, and
 not by sending "CREATE TABLE" statements directly, you won't have the
 problem, because Gambas only uses "integer" when creating an
 autoincrement integer field. For all other integer fields, it uses
 "INT4".

 Regards,
>> to be correct, that revision is this about? i couldn't find it in the ide?
>>
> 
> I said I *will* fix the bug. It is not yet committed!
> 

hmm, can you kindly tell me the revision number after it was done?

--
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Connection.Tables

2010-12-06 Thread tobias
hi,

> 
> Fix has been committed. You can now run "svn update" to get the fix.
> 
> Regards,
> 
> 

hmm, i used svn the first time ever and i didn't really know, what i was 
doing... i downloaded the source and just installed it...
(ubuntu 9.04) i did:
$ svn checkout 
https://gambas.svn.sourceforge.net/svnroot/gambas/gambas/branches/2.0

$ cd 2.0
$ ./reconf
$ ./configure -C
$ make
  ...
gbc_trans.c: In Funktion »read_integer«:
gbc_trans.c:104: Fehler: »LLONG_MAX« nicht deklariert (erste Benutzung 
in dieser Funktion)
gbc_trans.c:104: Fehler: (Jeder nicht deklarierte Bezeichner wird nur 
einmal aufgeführt
gbc_trans.c:104: Fehler: für jede Funktion in der er auftritt.)
make[4]: *** [gbc2-gbc_trans.o] Fehler 1
make[4]: Verlasse Verzeichnis '/home/tobias/2.0/main/gbc'

was raised. what did i do wrong?


tobi

--
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Tests against pointers in Gambas3

2011-01-12 Thread tobias
hi,

> Hi,
> 
> i study the cases of pointers and i found at this page
> http://www.yolinux.com/TUTORIALS/C++MemoryCorruptionAndMemoryLeaks.html
> 
> cases of program crashes from bad usage of pointers.
> 
> i made a test for
> Attempting to write to memory already freed.
> 
> ...
> 
> in this example i free the pointer and then try to write to it.
> The result is that i can write and read normally after Free(pPointer)
> 
> Is this ok?
> 

i noticed the same thing some time ago with a c program. this hasn't to 
be a bug in gambas... i think this is just as jussi said:
 > Seems that Gambas still owns that address, but it is not "protected" 
anymore

--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] DataSource.Cancel()

2011-01-15 Thread tobias
hi developers,

can you tell me please what the undocumented method DataSource.Cancel() 
does?

regards,
tobi

--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Custom Class question

2011-01-25 Thread tobias
hi,
i have a question about some source code from fabien from 8th november 
2009 about creating custom controls:

"I think for the begginnig you must to do an encapsulating classe.

It's a class that take a control as parameter. And give to it new
function or feature.

so:

=

CLASS CColourCombo

Private $hComboBox
Private $hObs as new Observer
Public sub _New(hCombo as ComboBox)

   $hComboBox = hCombo
   $hOBS=NEW Observer(hCombo) AS "MyCombo"
End


PUBLIC SUB MyCombo_Change()

   If $hCombox.Current.Text<0 then
 $hComboBox.BackColor=Color.Red
   else
 $hComboBox.BackColor=Color.White
   endif
end

'Form

Now in your form just add
Public sub _New
dim hCColourCombo as CColourCombo

hCColourCombo = new CColourCombo(MyComboBox)

endif


END

==
I think for the begginnig you must to do an encapsulating classe.




And now you have a combo box that change backcolour when the selected
value is negative !

It's more simple than a control if you have no so many feature to add.


Fabien"

i quite can't make this working for me. i corrected this a bit but in 
the forms _new() i get "Not enough arguments" in the creation of the 
CColourCombo: hCColourCombo = new CColourCombo(MyComboBox)

--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] gb.db.form driver missing

2011-02-16 Thread tobias
good evening,
i'm testing gb.db.form for some time now and got some confusing (in fact 
it is not that confusing, i can imagine the situation): i have a simple 
form form->datasource->databrowser
and my code is as follows:

PUBLIC hConn AS NEW Connection

PUBLIC SUB Form_Open()

hConn.Type = ...
hConn.Name = ...
hConn.Host = ...
hConn.Open()

END

and this results in an error "driver missing" even before Form_Open() is 
raised, right? if i change the code to initialize the connection in 
Form_Open() everything works... i don't know if it is much trouble to 
change this behavior and i don't think it is neccessary but i haven't 
found anything about this. i think to make a notice or something in the 
Database example would save people some time of figuring this out?

regards,
tobi

--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] ftpclient problems

2011-03-21 Thread tobias
good evening,

i am redirecting a question to you again:


this time it's about the FTPClient class. after some research and tries 
i managed it to upload a file from a pc to a specified directory on an 
ftp server and to download a file from the ftp server to pc.

1. problem:
the events FTPClient_Read(), _Connect() or _Error() don't raise.

2. problem:
it also interests how to display the messages shown in the console in 
the program

the source code follows. to test it successfully one has to change the 
ftp user data.

SOURCE CODE:

' Gambas class file

PUBLIC SUB Form_Open()

   FMain.Center
   FMain.Border = 1

END ' Form_Open()

PUBLIC SUB btnFileDownLoad_Click()
   DIM s AS String

   oFTPClient.URL = "www.sekundarschuleosterburg.de/AAA/db.css" ' source
---> path to the original file on the ftp server
   oFTPClient.User = "w00c1898"
   oFTPClient.Password = "f1#skso"
   oFTPClient.Get("/home/hans/db.232") ' destination, local path (save 
as...) on the pc
   TextArea1.Insert(oFTPClient.Status & gb.NewLine)

END ' btnFileDownLoad_Click() ---> GET

PUBLIC SUB btnFileUpLoad_Click()

   oFTPClient.URL = "www.sekundarschuleosterburg.de/abc.123" ' 
destination ---> path on the ftp server
   oFTPClient.User = "w00c1898"
   oFTPClient.Password = "f1#skso"
   oFTPClient.Put("/home/hans/abc.txt") ' source, path to the original 
file on the pc
   TextArea1.Insert(oFTPClient.Status & gb.NewLine)

END ' btnFileUpLoad_Click ---> PUT

PUBLIC SUB Form_Close()

   IF oFTPClient.Status = Net.Connected AND oFTPClient.Status <> 
Net.ReceivingData THEN
  oFTPClient.Close
   ENDIF

END ' Form_Close()

PUBLIC SUB oFTPClient_Connect()
   IF oFTPClient.Status = Net.Connecting THEN
  TextArea1.Text = "Es wird ..." & gb.NewLine
   ENDIF
END

PUBLIC SUB oFTPClient_Read()
   DIM sAntwort AS String

   TextArea1.Insert(oFTPClient.Status & gb.NewLine)
   'IF oFTPClient.Status = Net.Connected THEN
  'oFTPClient.Peek
  'READ #oFTPClient, sAntwort, Lof(oFTPClient)
  LINE INPUT #LAST, sAntwort
  'READ #LAST, sAntwort, -256
  TextArea1.Text = TextArea1.Text & sAntwort
  Label1.Caption = sAntwort
   'ENDIF

   'TextArea1.Insert("Verbunden" & gb.NewLine)

END

PUBLIC SUB oFTPClient_Error()

   TextArea1.Insert("FEHLER!" & gb.NewLine)

END

any help is appreciated.


regards,
tobi

--
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ftpclient problems

2011-03-22 Thread tobias
hello,

> I don't understand your english sentence in the point #2.
>  

yes, i don't understand the german original either, i just translated 
the words :)
i will ask for that sentence and the project.

regards.

--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Pointer to Datatypes

2011-03-28 Thread tobias
good evening all,

i've been having some trouble for a time with pointers in gambas 2. i 
mainly wrote programs in c the last year but now i mainly deal with 
gambas again because my class mates want some gui in the programs at 
school... it would be the greatest thing if i can pass some pointers to 
variables (strings and ints) to a function in a module because a huge 
amount of data has to be written to them directly. i could use a 
collection, too, but if i fill and return it, i have to worry about 
filling the local variables in the calling function. i haven't found 
anything to get the address of a variable or something similar and i 
also don't know if this could mess up some memory management of gambas 
and is therefore not implemented in gb2?

regards,
tobi

--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and publish 
your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] How can I print my Gambas program code?

2011-03-29 Thread tobias
hi,
hum, i would consider open your files in a program that can print texts?

regards,
tobi

--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] How to find out internet status

2011-04-03 Thread tobias
hi,

this for sure isn't the best solution but my first thought was using 
ifconfig to determine if your internet interface (maybe eth0 or 
whatever) has an ip address which should mean that it is connected..? (i 
don't know how it works with a modem)
this way you are at least independant of a test server.

another way may be found according to the following test:
in my case, i am connected to the internet via wlan0. my eth0 isn't 
connected to anything. in a terminal:
$ curl --interface wlan0 google.de
returns some html, while
$ curl --interface eth0 google.de
throws "curl: (7) Couldn't bind to 'eth0'"

but if i bring my inet connection with wlan0 down
$ curl --interface eth0 google.de
and
$ curl --interface wlan0 google.de
both will give "curl: (6) Couldn't resolve host 'google.de'"

if you look up the class Net in gb.net you'll find that there are status 
codes for those cases. so, if you haven't got a connection we are 
dependent on dns. but if you specify an non-existing host in a request 
with connection to the internet you'll get the same error. so far you 
are dependent of a test server again.

maybe this test inspires you...

regards,
tobi

--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] How to find out internet status

2011-04-04 Thread tobias
hi,

your whole code works fine for me.
are you sure that you really call this routine in the main program? this 
is the only reason i can think of...

--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] gambas2 - gambas3

2011-04-07 Thread tobias
hi developers,
i redirect another question:
is there a list that tells specifically what classes are 
removed/added/changed from gambas2 in gambas3?

best regards,
tobi

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] gambas2 - gambas3

2011-04-07 Thread tobias
good evening,
thank you, i hope this will do it for him!

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] gb2 Eval() question

2011-04-22 Thread tobias
hi,
i've been playing around with Eval() for some days, i read that it 
evaluates only expressions so i understand that DIMs raise "unexpected 
DIM" but what about SHELL and EXEC which also raise "unexpected ..." 
what is the difference between
Eval("hProcVar = SHELL \"zenity --info --text hello\" WAIT", hVarCollection)
and
Eval("iIntVar = 5 * 6", hVarCollection)?
I think both are assignments to variables and thus expressions? (The 
same with DIM Var AS Integer = 7 but which I think just tells to make 
room for a variable and initialises it so isn't an expression, right?)
I found nothing else in gb.eval Expression class than "You can use 
almost any Gambas subroutines and operators."
What are the criteria of a gambas expression?

best regards,
tobi

--
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] watcher class

2011-04-25 Thread tobias

hi,
i have to redirect a question again:
---
I need an example that demonstrates how to use the Watcher class and its 
4 events. can you look at the project and tell me if this is what the 
watcher class is about?

---

happy easter,
tobi


WATCHER-0.0.27.tar.gz
Description: GNU Zip compressed data
--
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] watcher class

2011-04-25 Thread tobias

hi,
thanks for your reply. i told him that it will be like this with the 
watcher but he didn't believe me :)
oh, i forgot to translate it because i don't even understand the concept 
of this test project... the english one is attached now..
i found that it may be difficult show the FMain because the start class 
(to selecting a language. maybe this component fails to translate the 
project for you?) is deleted... the program exits on my pc when the 
start class is deleted... i think this is logical and expected behaviour 
but i just translate this projects.


regards,
tobi


WATCHER-0.0.27.tar.gz
Description: GNU Zip compressed data
--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Anonymous Collection

2011-05-13 Thread tobias
hi,
i wonder if there is a way to declare an "anonymous collection" just as 
one would do it with arrays:
FOR EACH s IN ["a", "b"]
   PRINT s
NEXT

regards,
tobi

--
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] porting VB to GB3 "ListIndex" ?

2011-06-04 Thread tobias
hi,

i haven't got gambas3 already but in gb2 it's like this:
ComboBox1.Index + 2
(if i looked up correctly what combobox.ListIndex in vb means)
if you want to set the current item in this box, you can assign a number 
to combobox1.Index, setting combobox1.Current doesn't work...?
i hope this works for gb3, too. the docs doesn't say a word that Index 
is also read-only.

regards,
tobi

--
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Extra gb.newline ?

2011-06-09 Thread tobias
hi,
without having seen the code - i think it's all ok with your code - i'd 
say that the problem is in creation of the text file. editors like gedit 
are likely to add a newline at the end of file so it is shuffled into 
the second file, too. try to create your file like this in terminal:
echo -n "1,2,3,4,5,6,7,8,9,10" > test.txt
the -n switch disables the trailing newline...

regards,
tobi

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Multiline question

2011-06-10 Thread tobias
hello,
i have a question about long lines. i know one can split long 
IF-statements at logical operations like
IF TRUE = TRUE AND
FALSE = FALSE THEN
but is there a way to do that splitting in normal code? i think of 
something like
i = \
2

which should end up as
i = 2
for the interpreter. is there something like this?

regards,
tobi

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Multiline question

2011-06-10 Thread tobias
hi,

> You can do like this:
> 
> Foo=bar&
> Var1&
> &foo
> 
> Which results in: "barVar1foo"
> 

it doesn't work for me. is it a gambas3 thing?

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Multiline question

2011-06-10 Thread tobias
> What do you need exactly?

i think the person i am asking for means something like the backslash 
with defines in c:
#define MACRO(a, b) a \
+ b

i have no snippet from him and honestly i never had such a problem.

regards,
tobi

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Extra gb.newline ?

2011-06-10 Thread tobias
hi,
according to https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/379367 
this issue should be configurable in gedit now... i don't see it in my 
old version, but consider looking for it in yours.

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Extra gb.newline ?

2011-06-10 Thread tobias
oh,
i'm sorry, it seems not to be possible already, i just looked at "Gedit 
adding a newline at the end of file should be configurable " at the end 
and didn't notice that it is a quotation-.-

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ListBox selection

2011-06-15 Thread tobias
Hi,

yes, it's pretty straightforward, just use ListBox[Index].Selected (just 
to get their texts not the whole object in this example):

   DIM i AS Integer

   FOR i = 0 TO ListBox1.Count - 1
 IF ListBox1[i].Selected THEN
   PRINT ListBox1[i].Text
 ENDIF
   NEXT

regards,
tobi

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ListBox selection

2011-06-15 Thread tobias
but to answer your question
"is there a way to get in an array the selected items?"

no, this isn't possible because .ListBoxItems are virtual objects you 
can't store them into arrays but they only have .Selected and .Text, you 
know they're selected so the only thing you may need is .Text (as 
supposed in a String-Array) or if you want to modify those values, i 
suggest you returning the indices and referencing the .ListBoxItems with 
them again...

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ListBox selection

2011-06-15 Thread tobias
hi,

it's not clear to me what you want exactly.

"i want to multiple select values and able to delete them."

you want to select multiple items and delete them all? but why do you 
need Find() then?
can you explain it, please?

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ListBox selection

2011-06-15 Thread tobias
hi,

oh well, now i think i understood. but this doesn't change my answer:
you don't need find to get the index of a special item.
you said, you selected one or multiple items and you want to remove 
them. no problem, use the method i mentioned earlier in this topic:
PUBLIC SUB Button1_Click()

   DIM i AS Integer

   'Go through all items and find those that are selected
   FOR i = 0 TO ListBox1.Count - 1
 IF ListBox1[i].Selected THEN
   ListBox1.Remove(i)
 ENDIF
   NEXT

END

this code won't work properly, i saw while testing. (it raises "Bad 
Index" - it's "out of bounds") thanks to Benoit's answer i understand 
why. i iterate through all the indices until the initial ListBox1.Count 
which has changed during processing. but shouldn't such a FOR-loop be 
more dynamically? is this FOR-loop end point only evaluated at the 
beginning? or do i miss something else here?
why does the loop get into the iteration where the error is raised even 
if the condition shouldn't be true? (btw i'm using gambas2.22)

anyway you may use this one instead:

DIM i AS Integer

   'Go through all items and find those that are selected in a while 
which evaluates ListBox1.Count every iteration
   i = 0
   WHILE i < ListBox1.Count
 'is it selected?
 IF ListBox1[i].Selected THEN
   'remove and...
   ListBox1.Remove(i)
   'don't forget to decrement i because the relative offset of the 
next element has changed to the current offset, so one has to process 
the current index again
   DEC i
 ENDIF
 INC i
   WEND

or did i still not get what you wanted?

--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Catching an Event from an Object in another Class

2011-06-24 Thread tobias
hi everyone,

i want to get the Editor_Highlight event of an Editor on a form in a 
separate class, too. i have in the following in that class:

PRIVATE hEditor AS Editor

PUBLIC SUB _new(hSubject AS Editor)

   hEditor = hSubject

END

PUBLIC SUB hEditor_Highlight()

   PRINT Highlight.Text

END

in the form i just give my Editor to it:

Instance = NEW Class(Editor1)

but it doesn't work. i also tried using an extra Observer but i think i 
didn't unterstand something very fundamental in event management.
can anyone explain it to me?

regards,
tobi

--
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Catching an Event from an Object in another Class

2011-06-24 Thread tobias
hi,

> PUBLIC SUB _new(hSubject AS Editor)
> 
>   hEditor = hSubject
>   object.attach(hSubject, me, "heditor")
> 
> END
> 

thanks a lot. i just read this, too, but didn't notice that it could be 
significant.
anyway, thanks,
tobi

--
All the data continuously generated in your IT infrastructure contains a 
definitive record of customers, application performance, security 
threats, fraudulent activity and more. Splunk takes this data and makes 
sense of it. Business sense. IT sense. Common sense.. 
http://p.sf.net/sfu/splunk-d2d-c1
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Component Loading

2011-06-26 Thread tobias
hi,

i never used the Class class before and now tried, as a preparation for 
using Component class, to manually load a class.
the class looks like:
PUBLIC SUB _init()
   PRINT "Here I am"
END

if i load it using
Class.Load("testclass")
everything is fine.
i saw in the sources (just in a comment) that one can also put his 
components (and classes, too?) into ~/.local/lib/gambas2/ so i tried 
this one. when i Class.Load() there is no error saying that it isn't 
found but there is also no message...
can anyone explain it clearly to me?

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ScrollView properties

2011-06-26 Thread tobias
hi,

i am really tired today so i think that's the reason why i don't 
understand entirely what you want but i think i know...
you have a big picture in a ScrollView which is scrolled somewhere and 
you want to track the mouse position relatively to 0,0 on your picture, 
right?
i thought about this the last 15minutes and i think it's important to 
know WHEN you want these information...
you can have it immediately in a PictureBox_MouseDown() event using 
Mouse.X and Mouse.Y...
otherwise, i would work with the absolute mouse positions because these 
are the only ones you can access at any time (not only in an event like 
Mouse.X and .Y) and then subtract all child positions from ME to 
PictureBox (to get the mouse position relative to the picturebox 0,0) 
and then you got it.
my first thought was using ScrollView.ScrollWidth and ScrollView.ScrollX 
but that isn't neccessary in my opinion. may it help you if i was wrong 
with my thoughts...

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ScrollView properties

2011-06-26 Thread tobias
hi,

to be more exact. you should use:
PRINT Mouse.ScreenX - PictureBox1.ScreenX
this will give the position of the mouse relative to PictureBox1's 0,0 
which is the same as your pictures 0,0

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component Loading

2011-06-26 Thread tobias
hi,

oh well, it's a very confusing subject in my email, i'm sorry, it's 
about class loading as a preparation for component loading...
i figured it out by myself and the sources...
every class is compiled, named with capital letters without extension 
put into .gambas (in my gambas2) in the project directory. and, if i saw 
it right, these are also included in an executable archive. but they 
have to be unpacked, too, haven't they? i searched in ./, ~/ and /tmp/ 
but nothing...?
Benoît, can you explain this to me? i get headache from reading so much 
source code :)

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] External Variables

2011-06-27 Thread tobias
hi,

i have a component that should use a variable (or class) which is 
declared globally in a project. i know that this isn't good practice but 
i just want to know if it is possible to tell the compiler not to look 
for this variable and that it can be resolved when the component loaded. 
the only thing i found is a way to do it with a function:
EXTERN function() IN "lib"

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Create and delete labels dinamically

2011-06-27 Thread tobias
hi,

well, to have a dynamic array you need functions like .Add, Remove and 
stuff. this means that you have to use a class that implements these 
functions and deals with objects.
you may want to use the Object[]:

DIM aLabels AS NEW Object[]
DIM lblLabel AS NEW Label

aLabels.Add(lblLabel)

but be aware of the fact that when you create a control, you have 
(usually) to specify a parent so this control is shown on this parent 
once you created it.

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component Loading

2011-06-28 Thread tobias
hi,

> What do you want to do exactly?
> 

nothing, i just wanted to know where these compiled classes are. if i 
use an executable. i couldn't imagine that it is really not unpacked 
temporarily, but accessed directly...
anyway, thanks for the answer.



--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Menu over a control

2011-06-29 Thread tobias
hi,


> If I create TextLabels as you told me, I can get their tags, so I can
> identify them, but cannot remove them.
oh, of course, you can:
LAST.Delete()

> if I create them
> as a TextLabel[], I can add and remove them, but cannot figure which
> one of them has been clicked. How to make both of the option usable?
if you didn't know of Control.Delete(), i suppose, you removed them only 
from the array using Array.Remove() but in this case, the TextLabel is 
still on the form.

how do you create the array? in a similar way as you create the labels 
and add them to the action group:

DIM lblLabel AS Label
DIM aLabels AS NEW Object[]
DIM i AS Integer

FOR i = 0 TO 100 STEP 1
   lblLabel = NEW Label(ME) 'AS "MyText"
   aLabels.Add(lblLabel)
NEXT

in this case, of course, you cannot figure out, which one is clicked, 
because they even haven't got a Click()-Event-Handler. add one just as 
fabien did (it's commented out in the source above) and your event 
handler would be like:

PUBLIC SUB MyText_Click()
   LAST.Delete()
END


regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Menu over a control

2011-06-29 Thread tobias
hi,

i just installed kubuntu 11.04 yesterday, i couldn't compile gambas3 
with my old ubuntu...
i hope, i can figure it out at home, if your questions isn't answered 
then :)

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Dinamic lines

2011-06-29 Thread tobias
hi,

>> How to draw a line
>> How to draw a text
>> How to do it on a printer
>> How to do it on a canvas
>> How to make lines removable

imho, one should be able to figure some of these things out using the doc.
i never worked with printer, but answers to 1 and 2 are just where 
everyone expects them:
http://gambasdoc.org/help/comp/gb.qt4/draw?v3

i don't know what "canvas" is. i'm not a native english speaker and my 
dictionary gave me nothing programming related...

i don't think that lines can be made "removable" because you would have 
to have an object for them, i think. this would be waste of ram in my 
opinion and if you draw with a pencil on a paper, you don't create new 
objects that you can remove if you want to, right? :)
you have to use an eraser:
you can implement that by yourself saving source and destination coords 
of every line and if requested draw another line over it with your 
background's color... just a thought.

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Try Catch fail when using mkdir....

2011-06-30 Thread tobias
hi,

> Hi folks!
> 
> Gambas 2.99
> Fedora 14
> 
>Using mkdir with "catch" and "finally" to create a recursive SUB to 
> build a directory structure.
>The harness consists of FormMain with one big-friendly button on it, 
> pretty simple. Here is all of the code;
> 
> ' Gambas class file
> 
> Public Sub _new()
> 
> End
> 
> Public Sub Form_Open()
> 
> End
> 
> Private Sub CreateNewOutputFolder(psFolderSpecification As String)
>Dim sFolderSpec As String
> 
>sFolderSpec = psFolderSpecification
> 
>Mkdir sFolderSpec
> 
>Finally
>  Mkdir sFolderSpec
> 
>Catch
>  sFolderSpec = Mid$(psFolderSpecification, 1, 
> RInStr(psFolderSpecification, ".") - 1)
>  CreateNewOutputFolder(sFolderSpec)
> End
> 
> Public Sub Button1_Click()
> 
>CreateNewOutputFolder("/home/user/Rumple/Stilskin/Was/Here")
> 
> End
> 
> 
>What I THINK should happen is the initial mkdir should fail, the code 
> in "catch" should execute and copy the passed in parameter from position 
> 1 to the charcter just prior to the last "/" and then call itself 
> passing in the new result as the parameter. When/if that call fails (and 
> it should as this folder specification doesn't exist in my home dir) it 
> again recurses. This should go on until it reaches the left-most node in 
> the directory structure (AFTER the "/home/user"), and THAT one 
> ("/home/user/Rumple) should be the first to succeed in being created. 
> The call stack should then unwind, and as it does, the previous SUBS on 
> the stack should execute their "Finally" section. When the stack has 
> completely unwound the directory structure should exist only that is 
> not what is happening.
>The first Catch doesn't execute (although the directory does not get 
> created.. meaning an error did indeed occur) and it skips directly to 
> the "finally". When the mkdir in the "finally" is executed  (same 
> parameter string because we have not yet recursed) the error "File or 
> Directory does not exist" pops up on the screen. Well there's the error 
> that I expected from the initial mkdir, but the "catch" didn't execute, 
> anybody got ideas?
> 

first of all, i wouldn't use CATCH and FINALLY. for me, these are in my 
code only to handle errors. also calling the function recursively pushes 
unneccessary stackframes onto the stack because you can do this in a 
loop, too. last, i can't figure out the meaning of this line:
sFolderSpec = Mid$(psFolderSpecification, 1, 
RInStr(psFolderSpecification, ".") - 1)
why do you search for "." as your given string doesn't even contain one 
and you say that this code will copy the path until the prior char of 
the last "/"?
well, this is what i would have used:

PUBLIC SUB Button1_Click()

   BuildDirTree("home/user/This/../This//Is/.//../Not/../A/Tree")

END

PUBLIC SUB BuildDirTree(sPath AS String)

   DIM sCreate AS String = "/" 'Will contain the next path to create

   'make the path end with a "/"
   sPath &/= "/"

   'finish when we built the tree
   WHILE NOT (sCreate = sPath) OR NOT Exist(sPath)
 IF NOT Exist(sCreate) THEN
   MKDIR sCreate
   PRINT "[*] Creating "; sCreate
 ENDIF
 sCreate = Mid$(sPath, 1, InStr(sPath, "/", Len(sCreate) + 1))
 IF sCreate = "" THEN BREAK 'this will be the last part
   WEND
   PRINT "[*] Built successfully"

   CATCH
   Message.Info("Error: " & Error.Text)

END

which works just fine for me and i was suprised that it also handles 
this weird path i give...

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Component requirements

2011-07-03 Thread tobias
hi,

in a component, i need the gb.net component and so i added it to the 
list in requirements tab and compiled everything. if my component gets 
loaded, i get an error saying that i use an unknown symbol or something 
like that (it's some time ago and i just remembered that i wanted to ask 
for this) i thought that the requirements will be loaded automatically? 
(but this isn't said in the docs, i just noticed)
i tried to load gb.net manually but it didn't succeed. btw., i also load 
my own component manually with Component.Load().
how do i get it working?


regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component requirements

2011-07-03 Thread tobias
hi,

> 
> Please send your project and I will tell you.
> 

which project? component or project that uses it?
actually there is no "project". both are test cases.
in the component, there is:
PUBLIC SUB _init()
   DIM s AS NEW Socket
END

and in the project:
PUBLIC SUB Button1_Click()
   Component.Load("test_comp")
END

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component requirements

2011-07-03 Thread tobias


I need the component project.



o.k., the error was "Cannot load class 'Socket': unable to load class file".
component is attached.


test_comp-0.0.2.tar.gz
Description: GNU Zip compressed data
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component requirements

2011-07-03 Thread tobias

Benoît Minisini schrieb:

I need the component project.

o.k., the error was "Cannot load class 'Socket': unable to load class
file". component is attached.


OK, I see.

Component.Load("test_comp") will not force the load of the gb.net component. 
At the moment, the components dependencies are computed by the IDE, not at 
runtime.


I admit that should not be the case, but everything is not perfect yet. :-)

I think you can workaround the problem by:
- Checking the gb.net component in your project.
- Or adding 'Component.Load("gb.net")' in the component source code.

Note that the problem is the same in Gambas 3.

Regards,



i thought, i tried your second suggestion already but i'll see.
no, it's not working. project attached again.

but everything is not perfect yet. :-)

i'm glad to have found something that can be improved ;)


but it gets even stranger... (at least, i don't understand it):
if i open up the gambas ide and type to the console:

? Component.Load("test_comp")
Cannot load class 'Socket': Unable to load class file

so my problem persists.
then i clicked on the Save button to save my project and the ide crashes 
with something said about the "Null Object" if i already clicked to the 
Save button or "Unable to load class 'Save'..." if i click the first 
time. it's the same thing with almost any other control and even if i 
minimize the window...


(as i tested it again, the Save button worked... but the Create New 
Project button not. i hope, you can reproduce the error)


regards,
tobi


test_comp-0.0.6.tar.gz
Description: GNU Zip compressed data
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component requirements

2011-07-03 Thread tobias
> Can't load or create? ... looks like file/directory permissions or file
> mode issues to me.

can't be. usually there is no such error. just when i do 
Component.Load() in the console before.
and the modes of the gambas components aren't likely to change on my 
system ;)

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component requirements

2011-07-05 Thread tobias
hi,

> - Or adding 'Component.Load("gb.net")' in the component source code.

this is not working, i still get "Unable to load class 'Socket'"
what's wrong?
btw, have you noticed my explanation in the previous mail about the ide 
crashing? i don't want to be impatient but these two problems get me mad...

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component requirements

2011-07-05 Thread tobias
> 
> I think I see now: you are creating a Socket inside an _init method. But 
> _init 
> is called just after the class is loaded, and apparently before components.
> 
> Just create it elsewhere. I will try to see if I can run _init later, but it 
> is not sure.
> 
> Regards,
> 
thanks, this sounds logical. i'll try...
have you found anything regarding the other issue i noticed? were you 
able to reproduce the crashes?

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Component requirements

2011-07-05 Thread tobias

well, it still not works...
i create the socket within _call() now but i get the same message and 
the ide will crash again if i do something like minimizing and restoring 
it...


test_comp-0.0.10.tar.gz
Description: GNU Zip compressed data
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Component loading

2011-07-05 Thread tobias
hi,

i just noticed porting my component testing project to gambas3 that you 
removed the section from COMPONENT_load() which allows to have user 
components in ~/.local/lib/whatever ?
what's the reason? i really miss that...

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] ComboBox_Click Problem

2011-07-09 Thread tobias
hi,

i encountered a problem - for me - in gambas3 regarding ComboBox_Click() 
event. i have a directory name in ComboBox.Text and the contents of this 
directory in ComboBox.List. i implemented _Click() to append the current 
item's text to the directory path:

Public Sub ComboBox1_Click()

   Dim sPath As String

   Print ComboBox1.Text
   sPath = Mid$(ComboBox1.Text, 1, RInStr(ComboBox1.Text, "/"))
   ComboBox1.Text = sPath &/ ComboBox1.Current.Text

End

this results in e.g. "bin" (if ComboBox1.Text was "/" before) as output 
in terminal, so the ComboBox.Text is changed to the text of the selected 
item before the event is raised. i tried Stop Event but this didn't 
help. i want to preserve the previous text. the text of the current 
selected item is in ComboBox1.Current.Text, too, so it's twice available 
but i don't see a proper way to get the previous text.
or is this expected? i don't know if this is the same in gb2...

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] gb.Case

2011-07-09 Thread tobias
hi,

while the doc says that there is a constant gb.Case, the interpreter 
tells me that there is no symbol "Case" within gb.
gb.Text works well instead. but either the doc or the interpreter should 
be corrected ;)

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Creating Sound

2011-07-10 Thread tobias
hi,

(it's not a gambas specific question this time but i think at least 
related and maybe i benefit from your experiences)
i know how to play sound files using gb.sdl.sound but is there a way to 
create sound based on, let's say, sin() values?

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Creating Sound

2011-07-10 Thread tobias
On 10.07.2011 23:26, Kevin Fishburne wrote:
> On 07/10/2011 05:10 PM, tobias wrote:
>> hi,
>>
>> (it's not a gambas specific question this time but i think at least
>> related and maybe i benefit from your experiences)
>> i know how to play sound files using gb.sdl.sound but is there a way to
>> create sound based on, let's say, sin() values?
> That would be cool. I remember making sound effects that way using GW
> Basic ages ago. Maybe there's something in /dev/ that can be opened as a
> stream and read/written to directly?
>

i tried /dev/dsp some time ago but i couldn't figure out the format... 
(just saw that there is a suitable result with google). but now, on my 
fresh kubuntu, i can't even find any of the suggested sound device files...
i think it would be interesting to write some code based on this idea 
but does someone know of some other approches?

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Creating Sound

2011-07-10 Thread tobias
On 10.07.2011 23:26, Kevin Fishburne wrote:
>> On 07/10/2011 05:10 PM, tobias wrote:
>>> hi,
>>>
>>> (it's not a gambas specific question this time but i think at least
>>> related and maybe i benefit from your experiences)
>>> i know how to play sound files using gb.sdl.sound but is there a way to
>>> create sound based on, let's say, sin() values?
>> That would be cool. I remember making sound effects that way using GW
>> Basic ages ago. Maybe there's something in /dev/ that can be opened as a
>> stream and read/written to directly?
>>
wow, i quite can't figure out what my audio output device file is nor 
restore the /dev/dsp without causing my sound to be disabled...
that's weird!

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Desktop.SendKeys

2011-07-11 Thread tobias
hi,

i have an open terminal running a program that may run for long time. i 
want to use Desktop.SendKeys to send a CTRL+C to the terminal. (that's 
just an example. i know there are some very smarter ways of achieving 
that ;))
if i use
Desktop.SendKeys("{[CONTROL_L]C}") nothing happens but if no program 
runs i can see that the blinking cursor stops for a moment so my 
terminal seems to receive the keystrike...?
what's happening here?
btw, i think, the person i'm asking for wants to send CTRL+K to a gui 
application, so it has nothing to do with sending signals as in my 
example... but it is not working, too, while sending normal keys 
(without CTRL) works well...

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] How to stop an Observer?

2011-07-11 Thread tobias
hi,

i wonder how to stop an observer from raising events? my code 
demonstrative code looks like this:

(gambas2)

PRIVATE hObs AS Observer

PUBLIC SUB ObserveSubject(hSubject AS TextBox)
   IF hObs THEN
 ReleaseSubject()
   ENDIF
   hObs = NEW Observer(hSubject)
END

PUBLIC SUB ReleaseSubject()
   ???
END

i think, i'm missing something very basic here...

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ComboBox_Click Problem

2011-07-11 Thread tobias
On 11.07.2011 21:37, Matti wrote:
> Hi Tobias,
>
> for me, it looks like ComboBox.Text is made only to show something like 
> "Please
> select something" or "All entries". As soon as you select an item, 
> ComboBox.Text
> is replaced by that item. I tried the Click and the Change event, and in both
> cases it's gone. Benoit might correct me here.
>
> But this should be no problem: when you set ComboBox.Text, why don't you store
> your path in a variable and put it together afterwards with the selected item?
>
> Matti
>
> Am 09.07.2011 12:39, schrieb tobias:
>> hi,
>>
>> i encountered a problem - for me - in gambas3 regarding ComboBox_Click()
>> event. i have a directory name in ComboBox.Text and the contents of this
>> directory in ComboBox.List. i implemented _Click() to append the current
>> item's text to the directory path:
>>
>> Public Sub ComboBox1_Click()
>>
>>  Dim sPath As String
>>
>>  Print ComboBox1.Text
>>  sPath = Mid$(ComboBox1.Text, 1, RInStr(ComboBox1.Text, "/"))
>>  ComboBox1.Text = sPath&/ ComboBox1.Current.Text
>>
>> End
>>
>> this results in e.g. "bin" (if ComboBox1.Text was "/" before) as output
>> in terminal, so the ComboBox.Text is changed to the text of the selected
>> item before the event is raised. i tried Stop Event but this didn't
>> help. i want to preserve the previous text. the text of the current
>> selected item is in ComboBox1.Current.Text, too, so it's twice available
>> but i don't see a proper way to get the previous text.
>> or is this expected? i don't know if this is the same in gb2...
>>
>> regards,
>> tobi
>>
of course, but i consider this as a workaround...


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] How to stop an Observer?

2011-07-11 Thread tobias
On 11.07.2011 20:47, tobias wrote:
> hi,
>
> i wonder how to stop an observer from raising events? my code
> demonstrative code looks like this:
>
> (gambas2)
>
> PRIVATE hObs AS Observer
>
> PUBLIC SUB ObserveSubject(hSubject AS TextBox)
> IF hObs THEN
>   ReleaseSubject()
> ENDIF
> hObs = NEW Observer(hSubject)
> END
>
> PUBLIC SUB ReleaseSubject()
> ???
> END
>
> i think, i'm missing something very basic here...
>
> regards,
> tobi
oh, i just noticed the note in the online doc which is not present in my 
offline one:
The observer object is attached to the observed object, and is freed 
only when the observed object is freed too.

seems that there is no possibility without destroying the control. is 
there a way to copy an entire object, so i can create a new TextBox with 
the same property values?

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] How to stop an Observer?

2011-07-11 Thread tobias
On 11.07.2011 22:39, Benoît Minisini wrote:
>> On 11.07.2011 20:47, tobias wrote:
>>> hi,
>>>
>>> i wonder how to stop an observer from raising events? my code
>>> demonstrative code looks like this:
>>>
>>> (gambas2)
>>>
>>> PRIVATE hObs AS Observer
>>>
>>> PUBLIC SUB ObserveSubject(hSubject AS TextBox)
>>>
>>>  IF hObs THEN
>>>
>>>ReleaseSubject()
>>>
>>>  ENDIF
>>>  hObs = NEW Observer(hSubject)
>>>
>>> END
>>>
>>> PUBLIC SUB ReleaseSubject()
>>>
>>>  ???
>>>
>>> END
>>>
>>> i think, i'm missing something very basic here...
>>>
>>> regards,
>>> tobi
>> oh, i just noticed the note in the online doc which is not present in my
>> offline one:
>> The observer object is attached to the observed object, and is freed
>> only when the observed object is freed too.
>>
>> seems that there is no possibility without destroying the control. is
>> there a way to copy an entire object, so i can create a new TextBox with
>> the same property values?
>>
> Why do you want to stop the observer?
>
as usual, i'm just interested ;)
in my example, the raising of observer events may become unnecessary or 
unwelcome because they restrict a control (i wanted to try another way 
of limiting the input of a textbox to number only, for example).
now, i'm discovering
FOR EACH s IN Class.Load("TextBox").Symbols
to copy the entire textbox before deleting it to get rid of the events :)

regards,
tobi

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] How to stop an Observer?

2011-07-11 Thread tobias
of course, i could also use a flag instead, but i love it to research in 
the gambas universe :)

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] How to stop an Observer?

2011-07-11 Thread tobias
i also considered using Object.Lock() this works with the textbox but 
not with an observer...?

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


  1   2   3   4   5   6   7   8   9   10   >