I want to iterate through all the fields in a within a specific level of window delcaration heiracrchy and generate records that contain field names that exacly match the window declaration, so that I can more easily populate the record. I don't nessarily need to do this at runtime, - just want to avoid manually copying the fieldnames from the Window delaration to TYPE ... IS RECORD statement.
Your going to have to assign a data type to the fields of the record. You would probably want to do it based on the Class of the item. So if you use the ClassOf() function, you can get what you want. It would go something like this to assign the data type:
<font class="small">Code:</font><hr /><pre>
[-] PrintWindow2Record(WINDOW wWin)
[ ] integer i
[ ] string sDType
[ ] list of window lw
[ ] lw = WindowChildren(wWin)
[-] for i = 1 to ListCount(lw)
[-] switch [STRING]ClassOf(lw[i])
[-] case "TextField"
[ ] sDType = "STRING"
[-] case "PopupList"
[ ] sDType = "LIST OF STRING"
[-] case "CheckBox"
[ ] sDType = "BOOLEAN"
Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.