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