Jump to content

Better way to do this? Better language?


Kiai
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...