[Gambas-user] dateadd

Jeff Johnson jeffjohnson at ...377...
Fri Jun 24 02:52:36 CEST 2005


I will work on it.. I am sorry I just added in the wrong part.. I was using 
hButton.Text  not .name.. Bouncing back and forth between VB and Gambas too 
much.  It may not be able to be done.. But will play around with the object 
concept..
Thanks for all your help, I have it reading the TCPIP aprs servers, and 2 
radio TNC's and my home radio station and sorting everything out and 
transmitting via the radio my station. I just have not been able to delete a 
stupid button..


On Thursday 23 June 2005 19:16, Rob wrote:
> On Thursday 23 June 2005 18:36, Jeff Johnson wrote:
> >         textbox1.Text = hbutton.name
> >         i = hbutton.name
> >         hbutton(i).delete
>
> Well, here are the problems with that.
>
> 1. There is no "name" property for anything in Gambas.  I hope someday
> Benoit will change his mind about this ;)  Of course, in the example
> you give, the .name property in VB would have returned "hButton" so
> you would have been trying to delete "hButton(hButton)".
>
> 2. Adding multiple controls with the same name does not result in a
> control array being created in Gambas.
>
> Here is how I would write that routine (obviously not checked for
> syntax):
>
>      DIM hButtons as NEW Object[]
>      ' You probably want to make hButtons public and initialize it
>      ' in your Form_Open before doing any of this.
>
>      DO WHILE TRUE
>         hButton = NEW Button(ME) AS "Station"
>         hButton.X = rData!DLongitude
>         hButton.Y = rData!DLatitude
>         hButton.Raise
>         hButton.Text = rData!Station
>         hButton.Width = 75
>         hButton.Height = 7
>         hButton.Font.Size = 6
>         hButton.Picture = Picture[rData!Icon]
>         hButton.Tag = rData!Statusline
>         hButtons[rData!Station] = hButton
>         ' You didn't mention which field contained the name of
>         ' the button, so substitute that field for rData!Station
>         ' here and below.
>         mCount = mCount + 1
>
>         IF rdata!station = "THORN" THEN
>            textbox1.Text = rData!Station
>            hbuttons[rData!Station].delete
>         END IF
>
>         IF mCOunt = rData.Count THEN
>            BREAK
>         ENDIF
>         rdata.MoveNext
>      LOOP
>
> When you later wish to delete buttons, iterate through the hButtons
> array and check in the database to see if the button should be
> deleted.
>
> Rob
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user




More information about the User mailing list