Stubs File Generation

Selecting "Stubs" from the Generate dialog causes WorkShop Visual to generate a routine "stub" for each callback and method you have added in your design into a separate stubs file.

Once you have generated a stubs file you can add your own code into the routines. In order to avoid overwriting these additional lines, WorkShop Visual generates special comments to indicate which routines have previously been generated. These routines are then not overwritten and any new callbacks or methods are appended to the end of the file.

The special comments consist of a prelude which begins:


/* ** WorkShop Visual generated prelude.

and ends:


/* End of WorkShop Visual generated prelude */

The information inside this prelude will be generated anew each time to ensure that the list of include files is up-to-date.

There is also a special comment at the beginning of each routine which looks like this:


/* ** WorkShop Visual Stub */

It is very important that you do not alter or remove any of these comments if you wish your own additional code to be retained in the file. WorkShop Visual does, however, always make a backup of the file before creating a new one.

If you wish WorkShop Visual to regenerate one of the stubs, simply remove the comment preceding the stub and the stub itself. Remember that regeneration of a stub will lost the contents of the routine.

WorkShop Visual does not remove old stubs even after you have removed the callback or method. Remove the stub and the comment to remove the routine from the file.

If your file becomes large and full of unused code due to the fact that you have removed a number of callbacks and methods, you can force WorkShop Visual to generate a new file afresh by removing, or changing the name of, the old stubs file.

See also: