To convert a screen to a Windows form, use the Component Builder installed with Visual dBASE 5.7. To run the Component Builder, you will need to change the current folder to point to the folder containing the Component Builder.

To do this:

Click the “folder” pushbutton in the Navigator Window's "Current Directory" area

Select "Visualdb\utils\", the utils folder, and click "OK" (make sure you use the actual path for your installation of Visual dBASE 5.7).

In the Command Window, type:

  do cb

and press the Enter key. This will start the Component Builder program.

Note: When the Component Builder window appears, you’ll see it’s "Help" menu. If you need assistance, this is a good place to go.

A screen will appear showing the progress of the conversion. This will show the different types of objects, the lines, etc. Unless there is a serious error, the Component Builder will attempt to convert everything on this screen to a Windows object. If you have complex code, some of it may converted in which case you will need to make modifications.

When the screen is done being converted, click "OK" on the screen showing the progress bar, and exit the Component Builder.

Use the Navigator to go back to the folder with your Windows application. If you click on "Forms" in the Navigator you should see "Address.wfm" in the list on the right.

You will most likely need to fine-tune the job done by the Component Builder. There are some very good instructions on using the Form Designer in the section, “Using the Form and Report designers". Most of what is said can be applied to the Visual dBASE 5.7 form designer.

Using the Component Builder to convert a Form from a .PRG

The Component Builder menu contains an option to convert a .PRG to a:

.WFM (Windows Form) 

 or

.MNU (Menu) file. 

We’ve had little success with this option, however it’s included for those of you who would like to try. The process is similar to using the Component Builder to convert a .FMT to a .WFM file, with the exception that you need to highlight the source code you want to convert.

The difficulty with using the Component Builder for this conversion is that it does not understand much of the setup, contained in the program file, that most dBASE/DOS programs use to display screens. All it is looking for are the @/SAY, @/SAY/GET, and READ statements in the program.

If you choose this option:

  1. Use the Navigator to go to the Visualdb\UTILS folder

  2. Run the program CB.PRG

  3. Select the folder with the source code

  4. Select the program file you wish to convert, and click OK.

  5. A new window is displayed (See Figure 18.4)

  6.  Highlight the parts of the code you wish to convert and press Ctrl+C to "mark the text block".

  7.  Click the "Build Form" button

If you receive an error message stating: "Marked text block required", make sure you have pressed Ctrl+C after highlighting the code that you wish to convert.

If you continue to receive this error, we suggest that you copy the code to another file, rename it as an .FMT file, and retry the conversion using this new file.