{ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
 Ί                              EXAMPLE SOURCE                               Ί
 ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
 Ί                  To be used with MOS v3.0 Professional GUI                Ί
 ΜΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΉ
 Ί Coded by Zuul as BouFFtou as Cheveau Fr‚d‚ric.                            Ί
 Ί Source Turbo Pascal v7.00 generated by MRE (MOS Resource Editor) v2.8.    Ί
 Ί Contact us on MOS Home's Page - http://www.multimania.com/mos             Ί
 ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ}

{$M 65500,0,365520}                     {*Stack And Heap*}

Program Clock;                          {*Program Name*}

Uses Dos,                               {*Unit BP7 DOS*}
     MOS_VESA,MOS_DEB,                  {*Manage VESA and debug*}
     MOS_STR, MOS_BLK,                  {*Manage Strings and blankers*}
     MOS_CRT, MOS_BAS,                  {*Manage Initialisations and CRT*}
     MOS_ASM, MOS_MSE,                  {*Manage Assembler and Mouse*}
     MOS_IPX, MOS_XMS,                  {*Manage Networks and XMS Memory*}
     MOS_TOO, MOS_GAD,                  {*Manage Tools and Gadgets*}
     MOS_GFX, MOS_BMP,                  {*Manage Graphics and BMP*}
     MOS_WIN, MOS_MEN,                  {*Manage Windows and Menus*}
     MOS_WAV, MOS_VAR,                  {*Manage WAV Sounds*}
     MOS_DIR, MOS_SYS,                  {*Manage Disk and System*}
     MOS_TSK, MOS_LIS,                  {*Manage Tasks and Lists*}
     MOS_EZR, MOS_GPH,                  {*Manage Dialogs and Graph*}
     MOS_KBD, MOS_DSK,                  {*Manage Keyboard and Disk*}
     MOS_REQ, MOS_SWAP;                 {*Manage Requesters and Swap Disk*}

Function LeadingZero(w:Word):String;
Var S:String;
Begin
Str(w:0,s);
If Length(s)=1 Then s:='0'+s;
LeadingZero:=s;
End;

{ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
 Ί                             PROCEDURE Main                                Ί
 ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ}

Procedure Main(Px,Py:Integer);
Var W1            :TWindow;             {*Window Structure*}
    Even          :Byte;                {*Get Windows Evens*}
    XOk,XCancel   :Boolean;             {*Exit Flags*}
    St1           :String;
    OldS          :Byte;
    StV           :String;
    h, m, s, hund :Word;

{***************************** MAIN PROCEDURE *******************************}

Begin
Win_Init(Px,Py,Px+LaF*27,Py+HaF1+HaF*2,$5551,'',W1);
Win_Sup(100,50,250,200,79,60,639,479,0,0,$0A53,W1);{*Supplement*}
If NError<>0 Then Exit;                 {*Initialisations Errors ?*}
Win_Draw(W1);                           {*Display Window*}

XOk:=No; XCancel:=No;                   {*Init Exit Flags*}

Repeat
If Win_Ready(W1) Then                   {*Test if Window Ready*}
   Begin                                {*Test Personnals Gadgets*}
   Win_Clip(On,W1);                     {*Clipping Window*}
   GetTime(h,m,s,hund);
   St1:=LeadingZero(H); StV:=St1;
   St1:=LeadingZero(M); StV:=StV+':'+St1;
   St1:=LeadingZero(S); StV:=StV+':'+St1;
   If S<>OldS Then Begin                {*Display Digital Clock*}
      Display_LCD(10,5,11,':','LCDN.CHR',4,StV);
      OldS:=S;
      End;
   Win_Clip(Off,W1);                    {*Restore Normal Clipping*}
   End;

Even:=Win_Test(W1);                     {*Get Windows Evens*}
If Even=1 Then XCancel:=Yes;            {*Window Closed   => Exit*}
Until (XOk) Or (XCancel);               {*Exit Flags*}

Win_Kill(W1);                           {*Close Window if Needs*}
End;

{ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
 Ί                        MAIN PROGRAM (INITIALISATIONS)                     Ί
 ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ}

Begin
INIT_BASE;                               {*Initialise Hardware*}
INIT_SCREEN;                            {*Initialise Screen*}
INIT_MOUSE;                             {*Initialise Mouse*}

Oldexit:=ExitProc;                      {*Intercept Errors*}
SetJump(MyAddr);
ExitProc:=@ENTRY_INT24;

Main(0,0);                              {*Call the Digital Clock*}

DONE_MOUSE;                             {*Restore Mouse*}
DONE_SCREEN;                            {*Restore Screen*}
DONE_BASE;                               {*Restore Hardware*}
End.
