A System: Code Sample 1 - page 2

 
 
//< A.Core: Function 0004 >
 
//<   head >
 
int    afr.Core.TimerControl           ( // input 0 / code  2 / output 0
                                         //
                                         //
                                         //
                                         //
                                       ) //
 
//< / head >
 
{//<  body >
 
afr.Core.TimerPause ( ac.RunPeriod - afi.Core.TimerCount () )                                                  ; // 01
afr.Core.TimerStart ()                                                                                         ; // 02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}//</ body >
 
//</A.Core: Function 0004 >
  
 
 
//< A.Core: Interface 0001 >
 
//<   head >
 
int    aii.Core.State                  ( // input 0 / code 10 / output 1
                                         //
                                         //
                                         //
                                         //
                                       ) //
 
//< / head >
 
{//<  body >
 
static int    ali.Result                                                                                       ; // 01
                                                                                                                 // 02
static int    ali.Flag.1 ; if ( ali.Flag.1 == ac.Off ) { ali.Flag.1 = ac.On                                    ; // 03
  static int  ali.LastServerTime  ; ali.LastServerTime = TimeCurrent ()                                      ; } // 04
                                                                                                                 // 05
static int    ali.Flag.2 ; if ( ali.Flag.2 == ac.Off ) {                                                         // 06
  if        ( ali.LastServerTime != TimeCurrent ()   )                                                           // 07
            { ali.Flag.2 = ac.On  ; ali.Result = ac.On                                                     ; } } // 08
                                                                                                                 // 09
return      ( ali.Result )                                                                                     ; // 10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}//</ body >
 
//</A.Core: Interface 0001 >
  
 
 
//< A.Core: Interface 0002 >
 
//<   head >
 
int    aii.Core.Command                ( // input 0 / code 12 / output 1
                                         //
                                         //
                                         //
                                         //
                                       ) //
 
//< / head >
 
{//<  body >
 
static int    ali.Result                                                                                       ; // 01
                                                                                                                 // 02
ali.Result  = ac.Run                                                                                           ; // 03
                                                                                                                 // 04
static int    ali.Flag ; if ( ali.Flag == ac.Off ) {                                                             // 05
  if ( aii.Core.State  () ==  ac.On )                                                                            // 06
     { ali.Flag = ac.On     ; ali.Result = ac.Reset                                                        ; } } // 07
                                                                                                                 // 08
aii.Core.Exception    ( StringConcatenate ( "running " , ac.SystemName , " System" ) )                         ; // 09
afr.Core.TimerControl ()                                                                                       ; // 10
                                                                                                                 // 11
return      ( ali.Result )                                                                                     ; // 12
 
 
 
 
 
 
 
 
 
 
 
 
 
}//</ body >
 
//</A.Core: Interface 0002 >
  
 
 
//< A.Core: Interface 0003 >
 
//<   head >
 
int    aii.Core.Exception              ( // input 1 / code  9 / output 1
                                         //
       string aas.String = ""            //
                                         //
                                         //
                                       ) //
 
//< / head >
 
{//<  body >
 
static int    ali.Result                                                                                       ; // 01
                                                                                                                 // 02
ali.Result  = GetLastError ()                                                                                  ; // 03
                                                                                                                 // 04
if          ( ali.Result               != 0 )                                                                    // 05
if          ( StringLen ( aas.String ) != 0 )                                                                    // 06
              Alert     ( "Exception " , ali.Result , " " , aas.String )                                       ; // 07
                                                                                                                 // 08
return      ( ali.Result )                                                                                     ; // 09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}//</ body >
 
//</A.Core: Interface 0003 >
  
 
 
//< A.Module: Structure >
 
//<   property >
//< 0001> apr.Module.MainPage               // int  1 + double  0 + string  0 = elements  1
//< 0002>
//< 0003>
//< 0004>
//< 0005>
//< 0006>
//< 0007>
//< 0008>
//< 0009>
//< 0010>
//</  property >
 
//<   function >
//< 0001> afr.Module.Start                  // input 0 / code  1 / output 0
//< 0002> afr.Module.Compute                // input 0 / code 12 / output 0
//< 0003>
//< 0004>
//< 0005>
//< 0006>
//< 0007>
//< 0008>
//< 0009>
//< 0010>
//</  function >
 
//<   interface >
//< 0001> air.Module.Run                    // input 0 / code  4 / output 0
//< 0002>
//< 0003>
//< 0004>
//< 0005>
//< 0006>
//< 0007>
//< 0008>
//< 0009>
//< 0010>
//</  interface >
 
 
//</A.Module: Structure >
  
 
 
//< A.Module: Property 0001 >
 
//<   head >
 
//     apr.Module.MainPage               // int  1 + double  0 + string  0 = elements  1
                                         //
                                         //
                                         //
                                         //
                                         //
 
//< / head >
 
//<   body >
 
int    avi.Module.Number                                                                                     ; // 0001
                                                                                                               // 0002
                                                                                                               // 0003
                                                                                                               // 0004
                                                                                                               // 0005
                                                                                                               // 0006
                                                                                                               // 0007
                                                                                                               // 0008
                                                                                                               // 0009
                                                                                                               // 0010
                                                                                                               // 0011
                                                                                                               // 0012
                                                                                                               // 0013
                                                                                                               // 0014
                                                                                                               // 0015
                                                                                                               // 0016
                                                                                                               // 0017
                                                                                                               // 0018
                                                                                                               // 0019
                                                                                                               // 0020
                                                                                                               // 0021
                                                                                                               // 0022
                                                                                                               // 0023
                                                                                                               // 0024
 
//</  body >
 
//</A.Module: Property 0001 >
  
 
 
//< A.Module: Function 0001 >
 
//<   head >
 
int    afr.Module.Start                ( // input 0 / code  1 / output 0
                                         //
                                         //
                                         //
                                         //
                                       ) //
 
//< / head >
 
{//<  body >
 
avi.Module.Number = 1                                                                                          ; // 01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}//</ body >
 
//</A.Module: Function 0001 >
  
 
 
//< A.Module: Function 0002 >
 
//<   head >
 
int    afr.Module.Compute              ( // input 0 / code 12 / output 0
                                         //
                                         //
                                         //
                                         //
                                       ) //
 
//< / head >
 
{//<  body >
 
static int    ali.StartTime ; ali.StartTime = GetTickCount ()                                                  ; // 01
                                                                                                                 // 02
while ( GetTickCount ()     - ali.StartTime < ac.RunLimit [ avi.Module.Number ] )                                // 03
        Sleep ( 1 ) ;                                                                                            // 04
                                                                                                                 // 05
static int    ali.EndTime   ; ali.EndTime   = GetTickCount ()                                                  ; // 06
static int    ali.RunTime   ; ali.RunTime   = ali.EndTime - ali.StartTime                                      ; // 07
                                                                                                                 // 08
Alert ( avi.Module.Number , " " ,                                                                                // 09
        aii.Core.State () , " " ,                                                                                // 10
        ali.StartTime     , " " , ali.EndTime       , " " ,                                                      // 11
        ali.RunTime       , " " , ac.RunLimit [ avi.Module.Number ] )                                          ; // 12
 
 
 
 
 
 
 
 
 
 
 
 
 
}//</ body >
 
//</A.Module: Function 0002 >
  
 
 
//< A.Module: Interface 0001 >
 
//<   head >
 
int    air.Module.Run                  ( // input 0 / code  4 / output 0
                                         //
                                         //
                                         //
                                         //
                                       ) //
 
//< / head >
 
{//<  body >
 
static int    ali.Flag ; if ( ali.Flag == ac.Off ) { ali.Flag = ac.On                                          ; // 01
  afr.Module.Start ()                                                                                        ; } // 02
                                                                                                                 // 03
afr.Module.Compute ()                                                                                          ; // 04
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}//</ body >
 
//</A.Module: Interface 0001 >
  
 
 
//< A.System: Program >
 
//<   head >
 
int    A.System                        ( // input 0 / code  7 / output 0
                                         //
                                         //
                                         //
                                         //
                                       ) //
 
//< / head >
 
{//<  body >
 
while ( aii.Core.Command () == ac.Run )                                                                          //  1
      {                                                                                                          //  2
        air.Module.Run   ()                                                                                    ; //  3
//      air.******.Run   ()                                                                                    ; //  4
//      air.******.Run   ()                                                                                    ; //  5
//      air.******.Run   ()                                                                                    ; //  6
      }                                                                                                          //  7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}//</ body >
 
//</A.System: Program >
  
Reason: