document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. \' Gambas class file
  2.  
  3. Public Sub Form_Open()
  4.  
  5.   Dim a As Integer
  6.   Dim c As New MejoraColeccion
  7.   Dim c2 As New MejoraColeccion
  8.  
  9.   c.Add("hace mucho calor", "Sol")
  10.   c.Add("esta muy cerca del sol", "Mercurio")
  11.   c.Add("En su atmosfera no se puede respirar por el efecto invernadero", "Venus")
  12.   c.Add("Es el planeta azul... aunque cada vez es mas gris", "Tierra")
  13.   c.Add("Mas pequeño que la tierra, rojo y bastante ventoso", "Marte")
  14.  
  15.   Print c[0]
  16.   Print c[4]
  17.   c.add("muy grande, y con una mancha roja", "Jupiter")
  18.   Print c.Count
  19.  
  20.   Print c[c.count - 1]
  21.   Print c.Key(c.count - 1)
  22.   Print c["Jupiter"]
  23.   TextAreaContenido.text &= "--------------------------------------------------------" & gb.CrLf
  24.   TextAreaContenido.text &= "Recorrer Colección como si fuera un array  c " & gb.CrLf
  25.   TextAreaContenido.text &= "--------------------------------------------------------" & gb.CrLf
  26.   For a = 0 To c.count - 1
  27.     Print "Key:", c.Key(a), "Contenido:", c[a]
  28.     TextAreaContenido.text &= "Key: " & c.Key(a) & ", Contenido: " & c[a] & gb.CrLf
  29.   Next
  30.  
  31.   \'añado un valor mas a una copia
  32.   c2 = c.Copy()
  33.  
  34.   c2.add("El señor de los Anillos...", "Saturno")
  35.   TextAreaContenido.text &= "--------------------------------------------------------" & gb.CrLf
  36.   TextAreaContenido.text &= "Recorrer Colección como si fuera un array  c " & gb.CrLf
  37.   TextAreaContenido.text &= "--------------------------------------------------------" & gb.CrLf
  38.   For a = 0 To c.count - 1
  39.     Print "Key:", c.Key(a), "Contenido:", c[a]
  40.     TextAreaContenido.text &= "Key: " & c.Key(a) & ", Contenido: " & c[a] & gb.CrLf
  41.   Next
  42.  
  43.   TextAreaContenido.text &= "**** Copia alterada ****" & gb.CrLf
  44.   TextAreaContenido.text &= "--------------------------------------------------------" & gb.CrLf
  45.   TextAreaContenido.text &= "Recorrer Colección como si fuera un array  c2 " & gb.CrLf
  46.   TextAreaContenido.text &= "--------------------------------------------------------" & gb.CrLf
  47.   For a = 0 To c2.count - 1
  48.     Print "Key:", c2.Key(a), "Contenido:", c2[a]
  49.     TextAreaContenido.text &= "Key: " & c2.Key(a) & ", Contenido: " & c2[a] & gb.CrLf
  50.   Next
  51.  
  52.   Print c2["Jupiter"]
  53.  
  54. End
  55.  
  56. Public Sub Form_Resize()
  57.  
  58.   TextAreaContenido.w = Me.w - TextAreaContenido.y - 10
  59.   TextAreaContenido.h = Me.h - 20 - TextAreaContenido.y
  60.  
  61. End
');