[Gambas-user] DataReport Example

Fabien Bodard gambasfr at ...11...
Thu Dec 29 17:25:05 CET 2005


Le Jeudi 29 Décembre 2005 07:34, Ramon Orticio a écrit :
> may i pose the following inquiries regarding
> DataReportExample written by Rizky Tahara Shita
> (rizky at ...225...).
>
> 1. This Sub routine
>
> PUBLIC SUB TableView1_Data(Row AS Integer, Column AS
> Integer)
>   'the array's field name's
>
>  arrtable[0]="name"
>   arrtable[1]="dept"
>
>
>   WITH Mglobal
>     .rs1.MoveTo(Row)
>     tableview1.data.Text = Str(.rs1[arrtable[Column]])
>   END WITH
> END
>
> 1.1 this routine immeidately get focus and runs  even
> if not called.
>
> 1.2   when i tried to debug this routine it appears
> that there is an automatic looping even without the
> control structure to loop it.
>
> 1.3 how did the above happen? this is very nice but
> rather unusual in vb.
>
> 2. can textboxes be bound to a data in a particular
> field of
>    a recordset. i can't see a data property in
> textboxes.
>
> thanks
>
> ramon
>

Hi Ramon

For a thousand time, Gambas is not vb.

1.1.. We are calling that an event :) it exist under vb too.

In fact the data event is called when the tableview is drawed. it give the col 
and the row and we return the data to show by tableview.data.text. 
TableView.Data is an internal pointer that give the current drawed item.

TableView not contain any data as vb control did. it only show the data 
contained in an iternal result buffer or an array.

1.2... same reason... it's call for each cells

1.3 It's not vb !... but it's different mabe 1 or2 week to understand 
correctly the tableview and result interaction but all is possible.

2 no, you need to do that by hand. But it's not really difficult.

TextBox1.Text = Result!field
or
TextBox1.Text = Result["field"]

Mabe a few more work for that... 

TextBoxes are part of the gb.qt lib... and result part of the gb.db lib... 
Contrary to vb gambas is a terminal language... So the toolkit is not 
integrated to the interpreter.







More information about the User mailing list