Notes to Generate Delphi Code

*******************************Class Diagram************************************************
Class Diagram: pascar.omt
Script Files: delphi1.sct

The steps to generate Borland Delphi (Object Pascal) code and to compile the generated files are as follows:

>> Launch With Class from Windows
>> Open pascar.omt
>> Double click on each class to enter information in the Class Specification dialog box.  Enter Unit name in
the File Name box and enter the Uses Unit names in the Include File box.  Add a semicolon to the last unit
name
>> Select "Generate - Generate Class Code"
>> Select pas as the custom file extension
>> Select delphi1.sct to generate the Pascal units
>> Select "File - Edit File" to examine the generated files, e.g. carunit.pas
>> Launch your Delphi environment
>> Compile, make, and build each generated file, e.g. VehicleU.pas, MotorUn.pas, CellulaU.pas,
PassengU.pas, TireUnit.pas, and CarUnit.pas.


Notes for generating Object Pascal (Delphi and Turbo Pascal 5.5. or greater):
1) In With Class enter the unit name in the class specification dialog box "File Name" field.  The file name
becomes the unit file name and the unit name, e.g. file name = CarUnit.pas.
(2) For uses clause, enter the unit name in the Include Box.  Enter the last unit followed by a ; e.g. UnitZ;
Ensure that the unit names entered in the Include Box are consistent with the unit names entered in the
CLASS_FILENAME Box.
(3) On the class diagram, insert parameters in the C++ form, e.g. Parameter_Type Parameter_Name - Integer
aNumber.  The script variable PASCAL_OPERATION_PARAMETERS_WITH_VAR then puts the parameter
into the Pascal form, e.g. (Parameter_Name : Parameter_Type ; Var A_Parameter_Type : Parameter_Type) -
(A_Number : Integer ; Var A_Integer : Integer).
(4) In Delphi, create the user interface.  In the form unit, enter the unit name of the generated unit, e.g.
CARUNIT or CARS.  In the form class type section enter the object declaration, e.g. Car: car1;
In the form class procedures enter the messages to invoke generated code procedures, e.g.
car1.start;

************************************State Diagram*******************************************
State Diagrams: del1stat.omt and del2stat.omt
Script Files: delstat1.sct and delstat2.sct

The following are the general steps to test out the Object Pascal code generation scripts:

1. Create a directory for the state .omt files, script files, and Object Pascal files, e.g. WCSTATE.

2. Copy the appropriate files into each directory, e.g. copy st*.*.

3. In With Class open a state diagram, e.g. DEL1STAT.OMT.

4. Select Generate - Generate State Code to generate a text report.  Enter a report file name,
 e.g. RPTSTATE.TXT.  Select a state report script, e.g. RPTSTATE.SCT, DDSTATE.SCT, or TABSTATE.SCT.  
After report generation, select File - Edit File to examine the generated report.

5. Select Generate Generate Object Code/Report to generate Object Pascal code.

6. Enter the file name, e.g. CONTROLL.PAS

7. In the Object Pascal environment, compile and run the program.  

8. Go back to With Class and update the state diagram with new states, events, conditions, 
and actions and repeat the entire process.

*******************************************Object Interaction Diagram*******************************
Object Interaction Diagram: carobj.omt
Script Files: pasobmsg.sct

The steps to generate Borland Delphi (Object Pascal) messages to cut and paste into your Object Pascal code:

1. Open the object interaction diagram, e.g. carobj.omt

2. Select Generate Generate Generate Object Code/Report and select pasobmsg.omt

3. Enter the report file name, e.g. pasobmsg.txt

4. Cut each Object Pascal message and paste it into your class code.

Comments and suggestions are solicited.  Dick Felsinger 71162,755    803-881-3648
