I know I should know this one, but the brain cells just don't click.
I have a number of lables lblF0 - lblF15 in which the textcolour changes. At some point I need to preserve the current text colours. I have attempted to do this in a for/next in various ways but all have failed.
Below was the code starting point but this stores a string [eg "lblF1.TextColor"] not the color number.
B4X:
Dim Fcolours(16) As String
For FCol = 0 To 15
Fcolours(FCol) = "lblF"&FCol&".TextColor"
Next
Can you be more explicit?
Saving the values isn't really the problem, getting them via recursion instead of 16 lines of code to get them one by one is the problem.
I should have said in first post the text colour in the label indicates if there is an associated function. In some modes all these functions are disabled and re-enabled in the original mode. Therefore I need to save the text colour when leaving on mode and restore it when returning.
I thought a For/Next loop would be simple, I have gone for the 16 lines of code solution.