Win32lib dialogs within proc's
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Mar 09, 2000
- 497 views
I'm wondering if anyone has an elegant solution to this. I'm writing a windows program (actually porting a DOS program) using win32lib, and come to a section in a routine where I need to get some input from the user by opening up another dialog. An example would be: file = getOpenFileName(Main, "", {"All Files", "*.*"} ) But I'd like to get some information from one of _my_ dialogs. I figure that I could use a "callback" id, along with flags to let me know how far into the original routine I got, and just have the window call the callback when it's done, and add a bunch of 'if..then' statements looking at the various flags I've set. I don't want to do this yet, since I have about 60 or so routines, most of which would need this type of overhaul. Also, my future plands include porting the routines into a script that would allow me more flexibility etc, so I'll have to include into the scripting language any scheme that I come up with. Here's the basic format of what I have now: procedure foo( atom a, atom b, ) atom target while 1 do target = choose_target( a, "foo" ) if target then ....do stuff... else ....do other stuff... end if end while end procedure There may be other 'choose_target' (or equivalent) calls in the ....do stuff...., which is why I think I'd need flags or something. So, if anyone has any ideas, I'd _really_ love to hear them. Thanks, Matthew W Lewis