Skip to content
NNNIC edited this page Sep 8, 2018 · 9 revisions

Welcome to the psgg-delphi-sample wiki!

Environment

  • Windows 10
  • SYN-G-GEN
  • Delphi

How to make "m0" sample

1. Execute SYN-G-GEN and create a new state machine.

(1) Select Delphi STARTER KIT.
(2) Set the state machine name to "TestControl".
(3) Set the document folder to "c:\hoge\doc".
(4) Set the source folder to "c:\hoge".
(5) Select "YES" to copy State Manager.
(6) Create.

2. Copy "reference\Project01.dpr" to the source folder (c:\hoge).

(1) Double-click c:\hoge\Project01.dpr" to launch Delphi IDE.
(2) Debug-run the project with no error.
(3) Create

3. Print "Hallo World".

(1) Create a new state and input the below in 'input' cell.

  WriteLn('Hello World'); 

a0
(2) Run
a1

4. Make Branch

(1) Create new states as below
https://github.com/NNNIC/psgg-delphi-sample/raw/master/wiki/b0.png

(2) Modify the implementation source file.

  1. Add uses "System.DateUtils,SysUtils"
  2. Add "select_yes_no" declearation.
uses StateManagerUnit,System.DateUtils,SysUtils; // modified
type TestControl = class(StateManager)
  protected
    fbYesNo : boolean;
    procedure br_YES(const st: string);
    procedure br_NO(const st: string);
    procedure select_yes_no;                    // added
  1. Add "select_yes_no" implementaion
procedure TestControl.select_yes_no;
var i : integer;
begin
  i := MilliSecondOf( Now );

  WriteLn(i);

  fbYesNo := (i mod 2) = 0;
end;

(3) Run

b1