0

I have select Query that selects distinct value from a column. Is is possible to use these distinct values in my mapbasic program to make buttons and button labels?

More Info:

SQL Query : Select vendor from table_name ;

Now the selected vendors name are used to make buttons but I don't know how to get each row from table and put it in mapbasic variable. I am used to JAVA programming but don't know how it works in mapbasic. In java program we store the table in resultset and loop through it to get the row of column. I need to know how is it done in map basic. I read the mapbasic guide but could not get information about this kind of stuff.

  • What buttons? Of course, if it is a text field, you can use the text. You can also use these for function name calls I guess. You'll need to expand on what you need to do. As a word of advice, in future, could you put as much information as you can in your questions, as it makes them easier to answer, and we're all here to help. – Hairy Aug 17 '11 at 6:17
2
Open Table "MyTab.tab" as MyTable interactive
or Select Vendor from MyTable as Vendor

Fetch First From MyTable 
Do While Not EOT(MyTable)
    strVendor = MyTable.Vendor
    ...do stuff (call program to make buttons?)
Fetch Next from MyTable

Fetch First From Vendor
Do While Not EOT(Vendor)
    strVendor = Vendor.Col1
    ...do stuff (call program to make buttons?)
Fetch Next from Vendor

etc, etc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.