[Gambas-user] String array items filling ComboBox gives unexpected Click event with Index value of -1 and invalid Max property

Gianluigi bagonergi at gmail.com
Wed Jul 22 14:50:43 CEST 2020


Il giorno mer 22 lug 2020 alle ore 13:06 Christof Thalhofer <
chrisml at deganius.de> ha scritto:

> Am 22.07.20 um 10:46 schrieb John Rose:
>
> > Using Gambas 3.15 from stable builds.
>
> You mail is beeing bonced from all Gmail servers because of the
> 'TestApp.tar.gz' attachment.
>


Maybe attaching zip files will bypass the problem...

I would propose to John such a thing:

[code]
Public Sub Form_Open()
  Dim sProgrammes As New String[] ' NEW
  Dim sProgramme As String
  Dim aProg, aIndex, aChannel, aPid As New String[]

  Me.Title = "TestApp: Version " & Application.Version

  sProgrammes.Add("51: A History of Art in Three Colours - Blue, BBC Four,
b01lcz2s")
  sProgrammes.Add("52: A House Through Time: Series 1 - Episode 1, BBC Two,
b09l64zg")
  sProgrammes.Add("xyz: Rubbish, BBC Two, r123qw9x")
  sProgrammes.Add("7691: Your Money and Your Life: Series 1 - Episode 10,
BBC One, m000kc5x")
  '-------------------------------------------
  ComboBoxProgramme.List = sProgrammes
  For i As Integer = 0 To sProgrammes.Max
    sProgramme = sProgrammes.Pop()
    aIndex.Add(Trim(Scan(sProgramme, "*:*,*,*")[0]))
    aProg.Add(Trim(Scan(sProgramme, "*:*,*,*")[1]))
    aChannel.Add(Trim(Scan(sProgramme, "*:*,*,*")[2]))
    aPid.Add(Trim(Scan(sProgramme, "*:*,*,*")[3]))
  Next
  ComboBoxIndex.List = aIndex.Reverse()
  ComboBoxName.List = aProg.Reverse()
  ComboBoxChannel.List = aChannel.Reverse()
  ComboBoxPID.List = aPid.Reverse()

End

Public Sub ComboBoxProgramme_Click()

  Dim s As String = ComboBoxProgramme.Text
  Dim ss As String[] = Scan(s, "*:*,*,*")

  ComboBoxIndex.Text = Trim(ss[0])
  ComboBoxName.Text = Trim(ss[1])
  ComboBoxChannel.Text = Trim(ss[2])
  ComboBoxPID.Text = Trim(ss[3])

End
[/code]

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200722/0ec90bdb/attachment-0001.html>


More information about the User mailing list