' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '  
 '   ! E x S o c k e t . v b s  
 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '  
  
 '   G l o b a l   v a r i a b l e s  
 D i m   t i m s t r  
  
 '   E r r o r   h a n d l e r  
 O n   E r r o r   R e s u m e   N e x t  
  
 '   I n i t i a l i z e   g r a p h i c s   d i a l o g  
 I n i t G r a p h i c s   2 5 5 , 2 5 5 , 2 5 5  
 N a m e G r a p h i c s   " A t o m i c T i m e "  
  
 '   C r e a t e   G U I   o b j e c t s  
 C t l P u s h B u t t o n   1 0 1 , 2 0 , 2 0 , 2 0 0 , 2 0 , " G e t   A t o m i c   T i m e "  
 C t l E d i t               1 0 2 , 2 0 , 6 0 , 2 0 0 , 1 7 , " 1 2 3 "  
  
 '   I n f o   t e x t  
 D r a w T e x t   2 0 , 2 4 0 , " F 1   =   E x i t " , 0 , 0 , 0  
  
 '   S h o w   g r a p h i c s   d i a l o g  
 S h o w G r a p h i c s  
  
 S u b   g a t ( )  
   '   C r e a t e   s o c k e t   o b j e c t  
   S e t   s o c k   =   C r e a t e O b j e c t ( " W i n S o c k . W i n S o c k " )  
   '   S e t u p   s o c k e t   p a r a m e t e r s  
   s o c k . P r o t o c o l       =   0   ' 0 = T C P , 1 = U D P  
   s o c k . R e m o t e H o s t   =   " p t b t i m e 1 . p t b . d e "  
   s o c k . R e m o t e P o r t   =   1 3  
   t i m s t r   =   " "  
   s o c k . C o n n e c t  
   F o r   i = 1   T o   1 0  
     s o c k . G e t D a t a   t i m s t r  
     I f   t i m s t r   < >   " "   T h e n  
       E x i t   F o r  
     E n d   I f  
   N e x t  
   I f   t i m s t r   =   " "   T h e n  
     M s g B o x   " U n a b l e   t o   g e t   t i m e . " , " ! E x S o c k " , 0  
   E n d   I f  
   C t l S e t T e x t   1 0 2 , M i d ( t i m s t r , 1 , L e n ( t i m s t r ) - 2 )  
   s o c k . C l o s e  
   S e t   s o c k   =   N o t h i n g  
 E n d   S u b  
  
 '   E v e n t   l o o p  
 D o   W h i l e   T r u e  
       e v t   =   C t l G e t E v e n t s ( )  
       I f   e v t   < >   " "   T h e n  
             e v t   =   S p l i t ( e v t , " . " )  
             I f   ( e v t ( 0 ) = 0 )   A n d   ( e v t ( 1 ) = 1 )   T h e n  
                   H i d e G r a p h i c s  
                   E x i t   D o  
             E l s e  
                   I f   e v t ( 0 ) = 1 0 1   T h e n  
                         g a t  
                   E n d   I f  
             E n d   I f  
       E n d   I f  
       S l e e p   1  
 L o o p  
  
  
 