MOHIN_PASHA
2 years agoNew Contributor
How to convert the Strings to Objects so that the actions can be taken on the objects
Hi All,
I am trying to pass the strings as part of the objects but it is object not found error.
For eg:
I have a combo box which as 17 items in it. I have written a while loop to loop through all the items and select them. After selecting them, I am trying to verify the object with the selected item. This object varies whenever while loop iterates.
pallet_selected = "Pallet"+IntToStr(pallete_number+1)
Regions.pallet_selected.Check(imageCaptureAreaForPallet)
Here the pallet_selected varies every time. How can I convert this string into the Object.?
Try using the eval() method. For example,
var obj = eval("Regions.Pallet" + IntToStr(pallete_number + 1)); obj.Check(imageCaptureAreaForPallet);