Kiai Posted March 20, 2009 Share Posted March 20, 2009 From a novice programmer: I have written a program that started out small and is now a decent size (800 lines). It monitors for when a user is looking a few specific windows, then pulls info out of the window, presents a gui interface with options to quickly navigate to other parts of the same application (a medical records app). This is the main program loop: While 1 Select Case WinActive("New Results Patient's Name:") $RTE_window_open = 1 $title = WinGetTitle("New Results Patient's Name:") GUI_RTE() Case WinActive("", "Document Type: Letter") GUI_Sign_Print() Case WinActive("Inbox Message", $patient) And $clipboard = 1 GUI_Msg_paste() EndSelect Sleep(1000) WEnd As-is the program doesn't use up any significant resources. But, my question is, is there a better way to do what I'm doing than a loop like this with a pause? Also, having written this app with 800 lines of code, I wonder if (since it may wind up getting used by several hundred users) if it is worth considering converting it to another language such as visual basic. It works fine as-is, and performs functions quickly, but are there any advantages in terms of system performance (or security or anything else) to re-writing it in another language? Thanks. Link to comment Share on other sites More sharing options...
jvanegmond Posted March 20, 2009 Share Posted March 20, 2009 Kiai, one of the most important things ever is: Never change a successful formula. This has been translated into: Never change a succesful brand. Never change a winning team. and ofcourse.. Never change a succesful program. github.com/jvanegmond Link to comment Share on other sites More sharing options...
James Posted March 20, 2009 Share Posted March 20, 2009 Don't fix what isn't broken. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Kiai Posted March 21, 2009 Author Share Posted March 21, 2009 Don't fix what isn't broken.Thanks for the sage advice!I was trained as cobol programmer 20 years ago so am not as comfortable with objects. Is there a better way to patrol for the active windows that the program is waiting for other than the While Wend loop? Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 21, 2009 Share Posted March 21, 2009 Not unless you feel like hooking the CreateWindow function, no you're stuck looping. Link to comment Share on other sites More sharing options...
Kiai Posted March 22, 2009 Author Share Posted March 22, 2009 Not unless you feel like hooking the CreateWindow function, no you're stuck looping.Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now