Bon, si tu n'es pas rompu au manipulations des tableaux MetalOS, effectivement, je pense qu'il faut
que tu commences par bien appréhender ces concepts, car la maitrise des différents type de
données en prog est une des bases indispensable. Les tableaux en font partie. Comme dit au dessus,
il existe de bon tuto ici qui devrait te permettre de mieux comprendre les choses.
Pour ce qui est de ton projet d'application, voici un petit code rapide qui rempli des StringGadgets
avec les données qui sont extraites. C'est un code simple et basic, à toi de le décortiquer et d'en
comprendre les mécanismes (simples). En suite, je pense que tu n'auras aucun mal à l'adapter à tes
Code : Tout sélectionner
; un petit tableau global
Global Dim chaines$(12) ; 13 entrées possibles (de 0 à 12), correspondant aux nombre
; de stringGadgets définis.
;-----------------------------------
; zone de definition pour les gadgets,
; fait avec Visual Designer:
;-----------------------------------
;- Window Constants
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
Enumeration
#String_0
#String_1
#String_2
#String_3
#String_4
#String_5
#String_6
#String_7
#String_8
#String_9
#String_10
#String_11
#String_12
#Text_0
#Text_1
#Text_2
#Text_3
#Text_4
#Text_5
#Text_6
#Text_7
#Text_8
#Text_9
#Text_10
#Text_11
#Text_12
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 216, 0, 361, 471, "Meteo Test ( 0 )", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
StringGadget(#String_0, 60, 40, 100, 20, "")
StringGadget(#String_1, 60, 70, 100, 20, "")
StringGadget(#String_2, 60, 100, 100, 20, "")
StringGadget(#String_3, 60, 130, 100, 20, "")
StringGadget(#String_4, 60, 160, 100, 20, "")
StringGadget(#String_5, 60, 190, 100, 20, "")
StringGadget(#String_6, 60, 220, 100, 20, "")
StringGadget(#String_7, 60, 250, 100, 20, "")
StringGadget(#String_8, 60, 280, 100, 20, "")
StringGadget(#String_9, 60, 310, 100, 20, "")
StringGadget(#String_10, 60, 340, 100, 20, "")
StringGadget(#String_11, 60, 370, 100, 20, "")
StringGadget(#String_12, 60, 400, 100, 20, "")
TextGadget(#Text_0, 170, 40, 70, 20, "Texte1 ")
TextGadget(#Text_1, 170, 70, 70, 20, "Texte2 ")
TextGadget(#Text_2, 170, 100, 70, 20, "Texte3 ")
TextGadget(#Text_3, 170, 130, 70, 20, "Texte4 ")
TextGadget(#Text_4, 170, 160, 70, 20, "Texte5 ")
TextGadget(#Text_5, 170, 190, 70, 20, "Texte6 ")
TextGadget(#Text_6, 170, 220, 70, 20, "Texte7 ")
TextGadget(#Text_7, 170, 250, 70, 20, "Texte8 ")
TextGadget(#Text_8, 170, 280, 70, 20, "Texte9 ")
TextGadget(#Text_9, 170, 310, 70, 20, "TexteA ")
TextGadget(#Text_10, 170, 340, 70, 20, "TexteB ")
TextGadget(#Text_11, 170, 370, 70, 20, "TexteC ")
TextGadget(#Text_12, 170, 400, 70, 20, "TexteD ")
EndIf
EndIf
EndProcedure
;-----------------------------------------
; extraction des fameuse chaine, reprise
; du code que je donnais plus haut:chaines
;-----------------------------------------
text$ = "02:00 30/08/2008#14#88#11##0#080#1018######12#>10#E##16# "
num_chaines = 0
For k=1 To Len(text$)
a$= StringField(text$, k, "#")
If Len(a$)
chaines$(num_chaines) = a$
num_chaines + 1
; test de bornes très rudimentaire
If num_chaines > 12
num_chaines=0
EndIf
EndIf
Next
;--------------------------------------
; ouverture de la fenetre
;--------------------------------------
Open_Window_0()
;-----------------------------------------
; en suite on alimente les StringGadgets
; disponibles avec notre petit tableau
;-----------------------------------------
For k= #String_0 To #String_0+12
SetGadgetText(k, chaines$(k))
Next
;--------------------------------------
; attente
;--------------------------------------
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow