03-15-2017, 06:48 PM
Macro Macro2833
out
;Here I use an Excel file as a database.
;File: $documents$\toolbars.xls
;Sheet: Sheet1
;Data (3 columns):
;Label Code Icon
;One out 1 $qm$\paste.ico
;Two out 2
Database db.Open(db.CsExcel("$documents$\toolbars.xls")) ;;if error, close Excel. To see more examples, click word Database and press F1.
ARRAY(str) a; int c
db.QueryArr("SELECT * FROM [Sheet1$]" a) ;;first row is used for headers
str s
for c 0 a.len
,if(a[2 c].len) s+F"{a[0 c]} :{a[1 c]} * {a[2 c]}[]"
,else s+F"{a[0 c]} :{a[1 c]}[]"
;out s
DynamicToolbar s "test34598"