Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3780

Extends is genial

$
0
0

Hello everyone I do not come to ask a question but to share with you my joy of having found a great feature: “Extends”

For example, I want to place entetes on a box list.
Before doing this:

listeBox.HeaderAt ( 01 ) = "AA"
listeBox.HeaderAt ( 02 ) = "BB" 
listeBox.HeaderAt ( 03 ) = "CC" 
listeBox.HeaderAt ( 04 ) = "DD"

and now :

listeBox.headers ( “AA,BB,CC,DD” )

Here is the headers method placed in a module:
Var col As Integer
Var headers() As String

headers = L_headers.ToArray ( "," )
col = 0
For Each h As String In headers
  If col <= ListBox.LastColumnIndex Then
         ListBox.HeaderAt ( col ) = h
  Else
         ListBox.HeaderAt ( col ) = ""
  End If
  col = col + 1
Next

Exception err
Break
End Sub

And then for a dictionnary

Function listeKeys(Extends dico As Dictionary) As string
' Permet d'obtenir une liste des key cle01,cle02... d un dictionnaire

For Each de As DictionaryEntry In dico
  If tx_keys = "" Then
    tx_keys = tx_keys + de.Key.StringValue
  Else
    tx_keys = tx_keys + " , " + de.Key.StringValue
  End If 
Next

Return tx_keys

`

var liste as string = Un_Dico. listeKeys

`

6 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 3780

Trending Articles