You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

 

Below is the code, placed in the CLICK event of the Populate Combo Box button, that populates the combo box:

If you would like to populate the combo box automatically, place this code in the CREATE event of the window.  The button would be unnecessary.
$insert XO_Equates
hXO = XOInstance('NWIND')
if hXO then
 
  hQry = QryInstance(hXO)
 
    if hQry then
      flag = QryMethod(hQry, QRY_EXECUTE$, "select companyname from customers order by    companyname")
 
      row = ""
      results = ""
      loop
        flag = QryMethod(hQry, QRY_GETROW$, row)
      while flag
        results<-1> = row
      repeat
 
      QryMethod(hQry, QRY_DESTROY$)
    end
  
  rv = Set_Property (@window : '.COMPANIES', 'LIST', results)
 
  XOMethod(hXO, XO_DESTROY$)
 
end
  • No labels