I have some spinners named co_city, co_customers, co_seller, etc, and a rutine Fill_co(co as spinner, data as list) to fill the spinners with the members of a list.
To fill the list I use the PostString method to execute a query and receive the list from the database in the JobDone rutine. I also store the name of the spinner to be filled in a variable named Objecttofill.
Inside the JobDone rutine I use this code:
<code>
Select case Objecttofill
Case "co_cities"
Fill_co(co_cities,list)
Case "co_customers"
Fill_co(co_customers,list)
End Select
</code>
Instead of this code, I would like to do this:
Use a rutine Fill_co2(nco as string, data as list) and call it this way:
Fill_co2(Objecttofill,list)
Inside Fill_co2 I would use a code to transform the content of the string variable nco, into a spinner variable co and then use co.Add to fill the spinner.
How can I perform the last operation
To fill the list I use the PostString method to execute a query and receive the list from the database in the JobDone rutine. I also store the name of the spinner to be filled in a variable named Objecttofill.
Inside the JobDone rutine I use this code:
<code>
Select case Objecttofill
Case "co_cities"
Fill_co(co_cities,list)
Case "co_customers"
Fill_co(co_customers,list)
End Select
</code>
Instead of this code, I would like to do this:
Use a rutine Fill_co2(nco as string, data as list) and call it this way:
Fill_co2(Objecttofill,list)
Inside Fill_co2 I would use a code to transform the content of the string variable nco, into a spinner variable co and then use co.Add to fill the spinner.
How can I perform the last operation