As you expect, the first thing that you do in this function is call Update Data to populate the variables with the values of the controls on the window. The next thing that you do, however, might seem a little pointless. You declare a new C String variable and copy the value of the combo box to it. Is this really necessary when the value is already in a C String variable? Well, it depends on how you want your application to behave. The next line in the code is a call to the C String function Make Upper, which converts the string to all uppercase. If you use the C String variable that is attached to the combo box, the next time that Update Data is called with FALSE as the argument, the value in the combo box is converted to uppercase. Considering that this is likely to happen at an odd time, this is probably not desirable behavior. That’s why you use an additional C String
in this function.
Once you convert the string to all uppercase, you have a series of if statements that
compare the string to the names of the various programs. When a match is found, the
WinExec function is called to run the application. Now, if you compile and run your
application, you can select one of the applications in the drop-down list and run it by
clicking the Run Program button.