[Gambas-user] Sort a table view

Jack jscops at ...11...
Sat Aug 7 19:55:10 CEST 2004



Bonjour a tous,

Here is my probleme and i hope that you can understand me.

Look at the first screen. When i click on the "Nom" column the "Tri" routine 
is running and datas are sorted by name. This is good because "Dbt" variable 
= 0 and sub-routine Deb() is running.
Now when i type "r" letter it is always the sub-routine deb() whick work 
because "Dbt" is still = 0. Yet, when i type a letter i go to the 
N1_KeyPress() routine. It seem that the programme is reacting with two times 
delay ( see screen 2 and 3)

Anybody can help me ?

Thank you very much. 


Here the routines i use.

 PUBLIC SUB Tris() 
  DIM rResult AS Result
 DBASE()
  WITH Utils
        IF .conn(DB.host, DB.login, DB.password)=TRUE then
   .DB.Close
           .DB.Name=DB.name
           .DB.Open
          END IF
          END WITH
WITH colcli

  .Columns.count = 8
  .Columns[0].Width = 60
  .Columns[1].Width = 55
  .Columns[2].Width = 120
  .Columns[3].Width = 80
  .Columns[4].Width = 120
  .Columns[5].Width = 120
  .Columns[6].Width = 50
  .Columns[7].Width = 92
  
  .Columns[0].Text = "Code"
  .Columns[1].Text = "Civilité"
  .Columns[2].Text = "Nom"
  .Columns[3].Text = "Prénom"
  .Columns[4].Text = "Adresse 1"
  .Columns[5].Text = "Adresse 2"
  .Columns[6].Text = "CP"
  .Columns[7].Text = "Ville"
    END WITH
  IF Dbt = 0 THEN
   deb()
   ELSE
   Deb2()
  ENDIF
   DB.Close
 
END

PUBLIC SUB deb()
  
  Utils.colcli(colcli, "select * from "&Tab&" order by "&Tri&"")

  
END
PUBLIC SUB Deb2()
  Utils.colcli(colcli,"select * from "&Tab&" where "&Tri&" like  \""&sel&"%\" 
order by "&Tri&"")
END

PUBLIC SUB N1_Click()
DIM Cli_Nom AS String
sel = ""
C1.Text = ""
A1.Text = ""
CP1.Text = ""
V1.Text = ""
Tri = "Cli_Nom"
Tris()

END

PUBLIC SUB N1_KeyPress()
sel = N1.Text
IF sel ="" THEN 
Dbt = 0
ELSE
Dbt = 1
ENDIF
Tris()

END


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ecr1.jpg
Type: image/jpeg
Size: 62681 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20040807/6fa6522b/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ecr2.jpg
Type: image/jpeg
Size: 48364 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20040807/6fa6522b/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ecr3.jpg
Type: image/jpeg
Size: 42758 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20040807/6fa6522b/attachment-0002.jpg>


More information about the User mailing list