How do I convert text to an Object property ?

HarleyM

Member
Licensed User
Longtime User
Hi,

This has probably been discussed before, but a search through this forum hasn't helped so far...

I'm trying to set up an editable configuration file using Map & read the contents straight into code to typically change an items property i.e something along the lines of (simplified - I'm actually loading the text from a Map.GetValueAt(i) instruction)

Listview1.twoLinesAndBitmap.itemHeight = edtText.text
where edtText.text = 100dip or

ListView1.color = "colors." & edtText.text
where edtText.text is blue

I'm guessing that I have to parse this text as an attribute or something. I just need to get my head around the code needed. :sign0085:
 

derez

Expert
Licensed User
Longtime User
Try this:

Dim a as int
a = edttext.text
Listview1.twoLinesAndBitmap.itemHeight = a * 1dip

(where edttext.txt = 100)
 
Upvote 0

HarleyM

Member
Licensed User
Longtime User
Thanks for that...

Can you recommend something similar for a non-numeric property?

Cheers
 
Upvote 0

HarleyM

Member
Licensed User
Longtime User
Looking to change the look & feel on the fly while the program is running...

Thanks for all your input here. Very useful! :sign0060:

It would also be great to manipulate other textual type properties like

Gravity.RIGHT
Typeface.DEFAULT_BOLD

etc if possible.
 
Upvote 0
Top