regain #Gadget value from string ?
Posted: Wed Oct 20, 2010 3:14 am
Hello,
I'm struggling for hours but I simply can't find the answer how to get hold of a #Gadget ID-value by it's stringname? (Sorry for this curious expression but I also miss the words.)
I would like to process a row of gadgets within a loop and therefore need to replace the gadget-IDs by a further variable. The string notations only differ by their numbering to easily change them. Then I'm stuck not knowing how to grab the value adressed by the new string notation.
greetings ~ Vera
I'm struggling for hours but I simply can't find the answer how to get hold of a #Gadget ID-value by it's stringname? (Sorry for this curious expression but I also miss the words.)
I would like to process a row of gadgets within a loop and therefore need to replace the gadget-IDs by a further variable. The string notations only differ by their numbering to easily change them. Then I'm stuck not knowing how to grab the value adressed by the new string notation.
Code: Select all
Win_0 = OpenWindow(#PB_Any, 0, 0, 100, 100, "hui", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_TitleBar )
Str_0 = StringGadget(#PB_Any, 10, 10, 20, 24, "1")
Str_1 = StringGadget(#PB_Any, 40, 10, 20, 24, "2")
Str_2 = StringGadget(#PB_Any, 70, 10, 20, 24, "3")
For i= 0 To 2
strX.s = "Str_" + Str(i)
; strY = ; ???(strX) ;??? how to get the ID-value of Str_i
; Debug Str_0
Debug strX
Debug strY
; SetGadgetColor(strY, #PB_Gadget_BackColor, $00ccff)
Next i
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow