O p t i o n   I n f e r   O n 
 
 O p t i o n   E x p l i c i t   O f f 
 
 I m p o r t s   S y s t e m 
 
 I m p o r t s   S y s t e m . C o l l e c t i o n s . G e n e r i c 
 
 I m p o r t s   S y s t e m . L i n q 
 
 I m p o r t s   S y s t e m . L i n q . E x p r e s s i o n s 
 
 I m p o r t s   S y s t e m . T e x t 
 
 I m p o r t s   M   =   S y s t e m . M a t h 
 
 I m p o r t s   S y s t e m . C o l l e c t i o n s 
 
 I m p o r t s   < x m l n s : n s = " f o o " > 
 
 I m p o r t s   < x m l n s = " f o o " > 
 
 # C o n s t   l i n e   =   6 
 
 # C o n s t   f o o   =   T r u e 
 
 # I f   f o o   T h e n 
 
 # E l s e 
 
 # E n d   I f 
 
 '   T h e r e   i s   n o   e q u i v a l e n t   t o   # u n d e f   i n   V B . N E T : 
 
 ' # u n d e f   f o o 
 
 ' # w a r n i n g   f o o 
 
 ' # e r r o r   f o o 
 
 '   T h e r e   i s   n o   e q u i v a l e n t   t o   ' e x t e r n   a l i a s '   i n   V B : 
 
 ' e x t e r n   a l i a s   F o o ; 
 
 # I f   D E B U G   O r E l s e   T R A C E   T h e n 
 
 I m p o r t s   S y s t e m . D i a g n o s t i c s 
 
 # E l s e I f   S I L V E R L I G H T   T h e n 
 
 I m p o r t s   S y s t e m . D i a g n o s t i c s 
 
 # E l s e 
 
 I m p o r t s   S y s t e m . D i a g n o s t i c s 
 
 # E n d   I f 
 
 # R e g i o n   " R e g i o n " 
 
 # R e g i o n   " m o r e " 
 
 I m p o r t s   C o n s o l e A p p l i c a t i o n 2 . T e s t 
 
 # E n d   R e g i o n 
 
 I m p o r t s   X   =   i n t 1 
 
 I m p o r t s   X   =   A B C . X ( O f   I n t e g e r ) 
 
 I m p o r t s   A . B 
 
 
 
 # E n d   R e g i o n 
 
 < A s s e m b l y : S y s t e m . C o p y r i g h t ( " ( C )   2 0 0 9 " ) > 
 
 < M o d u l e : S y s t e m . C o p y r i g h t ( v b L f   &   v b T a b   &   C h r W ( & H 1 2 3 ) . T o S t r i n g ( )   &   " ( C )   2 0 0 9 "   &   C h r W ( & H 1 2 3 ) . T o S t r i n g ( ) ) > 
 
 F r i e n d   I n t e r f a c e   C o C o n t r a ( O f   O u t   T ,   I n   K ) 
 
 
 
 E n d   I n t e r f a c e 
 
 
 
 P u b l i c   D e l e g a t e   S u b   C o C o n t r a 2 ( ) 
 
 N a m e s p a c e   M y 
 
 
 
         F r i e n d   I n t e r f a c e   C o C o n t r a ( O f   O u t   T ,   I n   K ) 
 
 
 
         E n d   I n t e r f a c e 
 
 
 
         F r i e n d   D e l e g a t e   S u b   C o C o n t r a 2 ( O f   O u t   T ,   I n   K ) ( ) 
 
 
 
         P a r t i a l   P u b l i c   C l a s s   A 
 
                 I n h e r i t s   C S T y p e 1 
 
                 I m p l e m e n t s   I 
 
 
 
                 < O b s o l e t e ( ) > 
 
                 P u b l i c   S u b   N e w ( < O b s o l e t e ( ) >   B y V a l   f o o   A s   I n t e g e r ) 
 
                         M y B a s e . N e w ( 1 ) 
 
 L : 
 
                         D i m   i   A s   I n t e g e r   =   L e n ( N e w   I n t e g e r ) 
 
                         i   + =   1 
 
 # I f   D E B U G   T h e n 
 
                         C o n s o l e . W r i t e L i n e ( e x p o r t . i e f S u p p l i e d . c o m m a n d ) 
 
 # E n d   I f 
 
                         C o n s t   l o c a l ?   A s   I n t e g e r   =   I n t e g e r . M a x V a l u e 
 
                         C o n s t   l o c a l 0 ?   A s   G u i d   =   N e w   G u i d ( r . T o S t r i n g ( ) ) 
 
                         ' I n s e r t e d   C o m p i l i n g   c o d e   
 
                         D i m   r   A s   I n t e g e r 
 
                         D i m   V a r i o b l e l o c a l ?   A s   I n t e g e r   =   I n t e g e r . M a x V a l u e 
 
                         D i m   V a r i o b l e l o c a l 0 ?   A s   G u i d   =   N e w   G u i d ( r . T o S t r i n g ( ) ) 
 
                         D i m   ?@825B  =   l o c a l 
 
                         D i m   <8@  =   l o c a l 
 
                         D i m   l o c a l 3   =   0 ,   l o c a l 4   =   1 
 
                         D i m   l o c a l 5   =   I f ( T r y C a s t ( N o t h i n g ,   A c t i o n ) ,   N o t h i n g ) 
 
                         D i m   l o c a l 6   =   T y p e O f   l o c a l 5   I s   A c t i o n 
 
                         D i m   u   =   1 U I 
 
                         D i m   U _ R e n a m e d   =   1 U I 
 
                         D i m   h e x   A s   L o n g   =   & H B A D C 0 D E ,   H e x _ R e n a m e d   A s   L o n g   =   & H D E A D B E E F L ,   l   A s   L o n g   =   - 1 L ,   L _ R e n a m e d   A s   L o n g   =   1 L 
 
                         D i m   u l   A s   U L o n g   =   1 U L ,   U l _ R e n a m e d   A s   U L o n g   =   1 U L ,   u L _ R e n a m e d 2   A s   U L o n g   =   1 U L ,   U L _ R e n a m e d 3   A s   U L o n g   =   1 U L ,   l u   A s   U L o n g   =   1 U L ,   L u _ R e n a m e d 1   A s   U L o n g   =   1 U L ,   l U _ R e n a m e d 2   A s   U L o n g   =   1 U L ,   L U _ R e n a m e d 3   A s   U L o n g   =   1 U L 
 
                         D i m   b o o l   A s   B o o l e a n 
 
                         D i m   [ b y t e ]   A s   B y t e 
 
                         ' C h r W ( & H 0 1 3 0 ) ,   h e x c h a r 2   =   C h r W ( & H B A D ) 
 
                         ' C h r W ( & H 0 0 6 6 ) ,   h e x c h a r   =   C h r W ( & H 0 1 3 0 ) ,   h e x c h a r 2 
 
                         ' " c " c ,   \ u 0 0 6 6   =   C h r W ( & H 0 0 6 6 ) ,   h e x c h a r 
 
                         D i m   [ c h a r ]   A s   C h a r   =   " c " c   ' ,   \ u 0 0 6 6 
 
                         D i m   [ d e c i m a l ]   A s   D e c i m a l   =   1 . 4 4 D 
 
                         D i m   [ d y n a m i c ]   A s   O b j e c t 
 
                         D i m   [ d o u b l e ]   A s   D o u b l e   =   m . P I 
 
                         D i m   f l o a t   A s   S i n g l e 
 
                         D i m   i n t   A s   I n t e g e r   =   I f ( l o c a l ,   - 1 ) 
 
                         D i m   [ l o n g ]   A s   L o n g 
 
                         D i m   [ o b j e c t ]   A s   O b j e c t 
 
                         D i m   [ s b y t e ]   A s   S B y t e 
 
                         D i m   [ s h o r t ]   A s   S h o r t 
 
                         D i m   [ s t r i n g ]   A s   S t r i n g   =   " " " / * " 
 
                         D i m   u i n t   A s   U I n t e g e r 
 
                         D i m   [ u l o n g ]   A s   U L o n g 
 
                         D i m   [ u s h o r t ]   A s   U S h o r t 
 
                         D i m   d y n a m i c 1   =   l o c a l 5 
 
                         D i m   a d d   =   0 
 
                         D i m   a s c e n d i n g   =   0 
 
                         D i m   d e s c e n d i n g   =   0 
 
                         D i m   F r o m   =   0 
 
                         D i m   [ g e t ]   =   0 
 
                         D i m   [ g l o b a l ]   =   0 
 
                         D i m   g r o u p   =   0 
 
                         D i m   i n t o   =   0 
 
                         D i m   j o i n   =   0 
 
                         D i m   [ l e t ]   =   0 
 
                         D i m   o r d e r b y   =   0 
 
                         D i m   [ p a r t i a l ]   =   0 
 
                         D i m   r e m o v e   =   0 
 
                         D i m   [ s e l e c t ]   =   0 
 
                         D i m   [ s e t ]   =   0 
 
                         D i m   v a l u e   =   0 
 
                         D i m   v a r   =   0 
 
                         D i m   w h e r e   =   0 
 
                         D i m   y i e l d   =   0 
 
                         I f   i   >   0   T h e n 
 
                                 R e t u r n 
 
                         E l s e I f   i   =   0   T h e n 
 
                                 T h r o w   N e w   E x c e p t i o n ( ) 
 
                         E n d   I f 
 
 
 
                         D i m   o 1   =   N e w   M y O b j e c t ( ) 
 
                         D i m   o 2   =   N e w   M y O b j e c t ( v a r ) 
 
                         D i m   o 3   =   N e w   M y O b j e c t   W i t h   { . A   =   i } 
 
                         D i m   o 4   =   N e w   M y O b j e c t ( d y n a m i c )   W i t h   { . A   =   0 ,   . B   =   0 ,   . C   =   0 } 
 
                         D i m   o 5   =   N e w   W i t h   { K e y   . A   =   0 } 
 
                         D i m   a ( )   A s   I n t e g e r   =   { 0 ,   1 ,   2 ,   3 ,   4 ,   5 } 
 
                         S e l e c t   C a s e   i 
 
                                 C a s e   1 
 
                                         G o T o   C a s e L a b e l 1 
 
                                 C a s e   2 
 
 C a s e L a b e l 1 : 
 
                                         G o T o   C a s e L a b e l 2 
 
                                         E x i t   S e l e c t 
 
                                 C a s e   E l s e 
 
 C a s e L a b e l 2 : 
 
                                         R e t u r n 
 
                         E n d   S e l e c t 
 
 
 
                         D o   W h i l e   i   <   1 0 
 
                                 i   + =   1 
 
                         L o o p 
 
 
 
                         D o 
 
                                 i   + =   1 
 
                         L o o p   W h i l e   i   <   1 0 
 
 
 
                         F o r   j   A s   I n t e g e r   =   0   T o   9 9 
 
                                 C o n s o l e . W r i t e L i n e ( j ) 
 
                         N e x t   j 
 
 
 
                         ' M o d i f i e d   t o   i n c l u d e   i t e m s 
 
                         D i m   i t e m s   =   { 1 ,   2 ,   3 ,   4 ,   5 ,   6 ,   7 ,   8 } 
 
                         F o r   E a c h   i   I n   i t e m s 
 
                                 I f   i   =   7   T h e n 
 
                                         R e t u r n 
 
                                 E l s e 
 
                                         C o n t i n u e   F o r 
 
                                 E n d   I f 
 
                         N e x t   i 
 
 
 
                         '   T h e r e   i s   n o   e q u i v a l e n t   t o   a   ' c h e c k e d '   b l o c k   i n   V B . N E T 
 
                         ' 	 	 	 c h e c k e d 
 
                         i   + =   1 
 
                         ' M o d i f i e d   u s e   o f   s y n c l o c k   f u n c t i o n s   f o r   V B 
 
                         D i m   s T e x t   A s   S t r i n g 
 
                         D i m   o b j L o c k   A s   O b j e c t   =   N e w   O b j e c t ( ) 
 
                         S y n c L o c k   o b j L o c k 
 
                                 s T e x t   =   " H e l l o " 
 
                         E n d   S y n c L o c k 
 
 
 
                         U s i n g   v   =   B e g i n S c o p e ( ) 
 
                                 U s i n g   a   A s   N e w   A ( ) 
 
                                         U s i n g   B e g i n S c o p e ( ) 
 
                                                 R e t u r n 
 
                                         E n d   U s i n g 
 
                                 E n d   U s i n g 
 
                         E n d   U s i n g 
 
 
 
                         '   V B   d o e s   n o t   s u p p o r t   i t e r a t o r s   a n d   h a s   n o   e q u i v a l e n t   t o   t h e   C #   ' y i e l d '   k e y w o r d : 
 
                         ' y i e l d   R e t u r n   M e . i t e m s ( i ) 
 
                         '   V B   d o e s   n o t   s u p p o r t   i t e r a t o r s   a n d   h a s   n o   e q u i v a l e n t   t o   t h e   C #   ' y i e l d '   k e y w o r d : 
 
                         ' y i e l d ( b r e a k ) 
 
                         '   T h e r e   i s   n o   e q u i v a l e n t   t o   a   ' f i x e d '   b l o c k   i n   V B . N E T 
 
                         ' I n t e g e r *   p   =   N o t h i n g 
 
                         T r y 
 
                                 T h r o w   N e w   E x c e p t i o n   ' N o t h i n g 
 
                         C a t c h   a v   A s   S y s t e m . A c c e s s V i o l a t i o n E x c e p t i o n 
 
                                 T h r o w   a v 
 
                         C a t c h   e 1   A s   E x c e p t i o n 
 
                                 T h r o w 
 
                         F i n a l l y 
 
                         E n d   T r y 
 
 
 
                         D i m   a n o n y m o u s   =   N e w   W i t h   { . a   =   1 ,   . B   =   2 ,   . c   =   3 } 
 
                         D i m   q r y   =   F r o m   i 1   I n   { 1 ,   2 ,   3 ,   4 ,   5 ,   6 }   W h e r e   i 1   <   5   S e l e c t   N e w   W i t h   { . i d   =   i 1 } 
 
                         D i m   q u e r y   =   F r o m   c   I n   c u s t o m e r s   L e t   d   =   c   W h e r e   d   I s N o t   N o t h i n g   J o i n   c 1   I n   c u s t o m e r s   O n   c 1 . G e t H a s h C o d e ( )   E q u a l s   c . G e t H a s h C o d e ( )   G r o u p   J o i n   c 1   I n   c u s t o m e r s   O n   c 1 . G e t H a s h C o d e ( )   E q u a l s   c . G e t H a s h C o d e ( )   I n t o       e ( )   O r d e r   B y   g . C o u n t ( )   A s c e n d i n g   O r d e r   B y   g . K e y   D e s c e n d i n g   S e l e c t   N e w   W i t h   { . R e g i o n   =   g . K e y ,   . C u s t C o u n t   =   g . C o u n t ( ) } 
 
                         ' X M L   L i t e r a l s 
 
                         D i m   x   =   < x m l l i t e r a l > < t e s t   n a m e = " t e s t " / >   < t e s t   n a m e = " t e s t 2 " > < / t e s t > < / x m l l i t e r a l > 
 
                 E n d   S u b 
 
 
 
                 P r o t e c t e d   S u b   F i n a l i z e ( ) 
 
                 E n d   S u b 
 
 
 
                 P r i v a t e   R e a d O n l y   f 1   A s   I n t e g e r 
 
 
 
                 '   T h e r e   i s   n o   V B . N E T   e q u i v a l e n t   t o   ' v o l a t i l e ' : 
 
                 < O b s o l e t e ( ) ,   N o n E x i s t i n g ( ) ,   F o o . N o n E x i s t i n g ( v a r ,   5 ) ,   O b s o l e t e ( ) ,   N o n S e r i a l i z e d ( ) ,   C L S C o m p l i a n t ( T r u e   O r E l s e   F a l s e   A n d   T r u e ) > 
 
                 P r i v a t e   f 2   A s   I n t e g e r 
 
 
 
                 < O b s o l e t e ( ) > 
 
                 P u b l i c   S u b   H a n d l e r ( B y V a l   v a l u e   A s   O b j e c t ) 
 
                 E n d   S u b 
 
 
 
                 P u b l i c   F u n c t i o n   m ( O f   T   A s   { C l a s s ,   N e w } ) ( B y V a l   t 1   A s   T )   A s   I n t e g e r 
 
                         M y B a s e . m ( t 1 ) 
 
                         R e t u r n   1 
 
                 E n d   F u n c t i o n 
 
 
 
                 P u b l i c   P r o p e r t y   P ( )   A s   S t r i n g 
 
                         G e t 
 
                                 R e t u r n   " A " 
 
                         E n d   G e t 
 
 
 
                         S e t ( B y V a l   v a l u e   A s   S t r i n g ) 
 
                         E n d   S e t 
 
                 E n d   P r o p e r t y 
 
 
 
                 P u b l i c   R e a d O n l y   P r o p e r t y   p 2   A s   S t r i n g 
 
                         G e t 
 
                         E n d   G e t 
 
                 E n d   P r o p e r t y 
 
 
 
                 P u b l i c   P r o p e r t y   p 3   A s   S t r i n g 
 
 
 
                 D e f a u l t   P u b l i c   P r o p e r t y   i t e m ( B y V a l   i n d e x   A s   I n t e g e r )   A s   I n t e g e r 
 
                         P r o t e c t e d   G e t 
 
                         E n d   G e t 
 
 
 
                         S e t ( B y V a l   v a l u e   A s   I n t e g e r ) 
 
                         E n d   S e t 
 
                 E n d   P r o p e r t y 
 
 
 
                 < O b s o l e t e ( ) ,   O b s o l e t e ( ) > 
 
                 P u b l i c   C u s t o m   E v e n t   E 1   A s   A c t i o n 
 
                         '   T h i s   c o d e   w i l l   b e   r u n   w h e n   A d d H a n d l e r   M y E v e n t ,   D 1   i s   c a l l e d 
 
                         A d d H a n d l e r ( B y V a l   v a l u e   A s   A c t i o n ) 
 
                         E n d   A d d H a n d l e r 
 
 
 
                         '   T h i s   c o d e   w i l l   b e   r u n   w h e n   R e m o v e H a n d l e r   M y E v e n t ,   D 1   i s   c a l l e d 
 
                         R e m o v e H a n d l e r ( B y V a l   v a l u e   A s   A c t i o n ) 
 
                         E n d   R e m o v e H a n d l e r 
 
 
 
                         < O b s o l e t e ( ) > 
 
                         R a i s e E v e n t ( ) 
 
                         E n d   R a i s e E v e n t 
 
                 E n d   E v e n t 
 
 
 
                 P u b l i c   S h a r e d   O p e r a t o r   + ( B y V a l   f i r s t ,   B y V a l   s e c o n d ) 
 
                         D i m   h a n d l e r   A s   S y s t e m . D e l e g a t e   =   N e w   [ D e l e g a t e ] ( A d d r e s s O f   M e . H a n d l e r ) 
 
                         R e t u r n   f i r s t . A d d ( s e c o n d ) 
 
                 E n d   O p e r a t o r 
 
 
 
                 < O b s o l e t e ( ) > 
 
                 P u b l i c   S h a r e d   O p e r a t o r   I s T r u e ( B y V a l   a   A s   A )   A s   B o o l e a n 
 
                         R e t u r n   T r u e 
 
                 E n d   O p e r a t o r 
 
 
 
                 P u b l i c   S h a r e d   O p e r a t o r   I s F a l s e ( B y V a l   a   A s   A )   A s   B o o l e a n 
 
                         R e t u r n   F a l s e 
 
                 E n d   O p e r a t o r 
 
 
 
                 C l a s s   c 
 
 
 
                 E n d   C l a s s 
 
 
 
                 P u b l i c   S u b   A ( B y V a l   v a l u e   A s   I n t e g e r )   I m p l e m e n t s   I . A 
 
                 E n d   S u b 
 
 
 
                 P u b l i c   P r o p e r t y   V a l u e   A s   S t r i n g   I m p l e m e n t s   I . V a l u e 
 
                         G e t 
 
                         E n d   G e t 
 
 
 
                         S e t ( B y V a l   v a l u e   A s   S t r i n g ) 
 
                         E n d   S e t 
 
                 E n d   P r o p e r t y 
 
         E n d   C l a s s 
 
 
 
         P u b l i c   S t r u c t u r e   S 
 
                 I m p l e m e n t s   I 
 
 
 
                 P r i v a t e   f 1   A s   I n t e g e r 
 
 
 
                 '   T h e r e   i s   n o   V B . N E T   e q u i v a l e n t   t o   ' v o l a t i l e ' : 
 
                 '   p r i v a t e   v o l a t i l e   i n t   f 2 ; 
 
                 < O b s o l e t e ( ) > 
 
                 P r i v a t e   f 2   A s   I n t e g e r 
 
 
 
                 P u b l i c   F u n c t i o n   m ( O f   T   A s   { S t r u c t u r e ,   N e w } ) ( B y V a l   s   A s   T )   A s   I n t e g e r 
 
                         R e t u r n   1 
 
                 E n d   F u n c t i o n 
 
 
 
                 P u b l i c   P r o p e r t y   P 1 ( )   A s   S t r i n g 
 
                         G e t 
 
                                 D i m   v a l u e   A s   I n t e g e r   =   0 
 
                                 R e t u r n   " A " 
 
                         E n d   G e t 
 
 
 
                         S e t ( B y V a l   v a l u e   A s   S t r i n g ) 
 
                         E n d   S e t 
 
                 E n d   P r o p e r t y 
 
 
 
                 ' v b . n e t   c a n ' t   s u p p o r t   a b s t r a c t   m e m b e r   v a r i a b l e 
 
                 P u b l i c   R e a d O n l y   P r o p e r t y   P 2 ( )   A s   S t r i n g 
 
                         G e t 
 
                         E n d   G e t 
 
                 E n d   P r o p e r t y 
 
 
 
                 P u b l i c   P r o p e r t y   p 3   A s   S t r i n g   ' / / A u t o   P r o p e r t y 
 
 
 
                 D e f a u l t   P u b l i c   P r o p e r t y   i t e m ( B y V a l   i n d e x   A s   I n t e g e r )   A s   I n t e g e r 
 
                         G e t 
 
                         E n d   G e t 
 
 
 
                         F r i e n d   S e t ( B y V a l   v a l u e   A s   I n t e g e r ) 
 
                         E n d   S e t 
 
                 E n d   P r o p e r t y 
 
 
 
                 P u b l i c   E v e n t   E ( ) 
 
 
 
                 P u b l i c   S h a r e d   O p e r a t o r   + ( B y V a l   f i r s t ,   B y V a l   s e c o n d ) 
 
                         R e t u r n   f i r s t . A d d ( s e c o n d ) 
 
                 ' f i x e d   I n t e g e r   f i e l d ( 1 0 ) 
 
                 E n d   O p e r a t o r 
 
 
 
                 C l a s s   c 
 
 
 
                 E n d   C l a s s 
 
 
 
                 P u b l i c   S u b   A ( B y V a l   v a l u e   A s   I n t e g e r )   I m p l e m e n t s   I . A 
 
                 E n d   S u b 
 
 
 
                 P u b l i c   P r o p e r t y   V a l u e   A s   S t r i n g   I m p l e m e n t s   I . V a l u e 
 
                         G e t 
 
                         E n d   G e t 
 
 
 
                         S e t ( B y V a l   v a l u e   A s   S t r i n g ) 
 
                         E n d   S e t 
 
                 E n d   P r o p e r t y 
 
         E n d   S t r u c t u r e 
 
 
 
         P u b l i c   I n t e r f a c e   I 
 
 
 
                 S u b   A ( B y V a l   v a l u e   A s   I n t e g e r ) 
 
 
 
                 P r o p e r t y   V a l u e ( )   A s   S t r i n g 
 
 
 
         E n d   I n t e r f a c e 
 
 
 
         < F l a g s ( ) > 
 
         P u b l i c   E n u m   E 
 
                 A 
 
                 B   =   A 
 
                 C   =   2   +   A 
 
 # I f   D E B U G   T h e n 
 
                 D 
 
 # E n d   I f 
 
         E n d   E n u m 
 
 
 
         P u b l i c   D e l e g a t e   S u b   [ D e l e g a t e ] ( B y V a l   P   A s   O b j e c t ) 
 
 
 
         N a m e s p a c e   T e s t 
 
 
 
                 P u b l i c   C l a s s   !?8A>:
 
 
 
                         P u b l i c   S h a r e d   F u n c t i o n   P o w e r ( B y V a l   n u m b e r   A s   I n t e g e r ,   B y V a l   e x p o n e n t   A s   I n t e g e r )   A s   I E n u m e r a b l e 
 
                                 D i m   !?8A>:  A s   N e w   !?8A>:( ) 
 
                                 !?8A>:. M a i n ( ) 
 
                                 D i m   c o u n t e r   A s   I n t e g e r   =   0 
 
                                 D i m   r e s u l t   A s   I n t e g e r   =   0 
 
                         ' D o   W h i l e   + + c o u n t e r + +   <   - - e x p o n e n t - - 
 
                         '                                                   r e s u l t   =   r e s u l t   *   n u m b e r   +   + n u m b e r   +   + + + + n u m b e r 
 
                         '                                 '   V B   d o e s   n o t   s u p p o r t   i t e r a t o r s   a n d   h a s   n o   e q u i v a l e n t   t o   t h e   C #   ' y i e l d '   k e y w o r d : 
 
                         '                                 ' y i e l d   R e t u r n   r e s u l t 
 
                         '                         L o o p 
 
                         E n d   F u n c t i o n 
 
 
 
                         S h a r e d   S u b   M a i n ( ) 
 
                                 F o r   E a c h   i   A s   I n t e g e r   I n   P o w e r ( 2 ,   8 ) 
 
                                         C o n s o l e . W r i t e ( " { 0 }   " ,   i ) 
 
                                 N e x t   i 
 
 
 
                         E n d   S u b 
 
                 E n d   C l a s s 
 
         E n d   N a m e s p a c e 
 
 E n d   N a m e s p a c e 
 
 
 
 N a m e s p a c e   C o n s o l e A p p l i c a t i o n 1 
 
         N a m e s p a c e   R e c u r s i v e G e n e r i c B a s e T y p e 
 
 
 
                 M u s t I n h e r i t   C l a s s   A ( O f   T ) 
 
                         I n h e r i t s   B ( O f   A ( O f   T ) ,   A ( O f   T ) ) 
 
 
 
                         P r o t e c t e d   O v e r r i d a b l e   F u n c t i o n   M ( )   A s   A ( O f   T ) 
 
                         E n d   F u n c t i o n 
 
 
 
                         P r o t e c t e d   M u s t O v e r r i d e   F u n c t i o n   N ( )   A s   B ( O f   A ( O f   T ) ,   A ( O f   T ) ) 
 
 
 
                         S h a r e d   F u n c t i o n   O ( )   A s   B ( O f   A ( O f   T ) ,   A ( O f   T ) ) 
 
                         E n d   F u n c t i o n 
 
                 E n d   C l a s s 
 
 
 
                 C l a s s   B ( O f   T 1 ,   T 2 ) 
 
                         I n h e r i t s   A ( O f   B ( O f   T 1 ,   T 2 ) ) 
 
 
 
                         P r o t e c t e d   O v e r r i d e s   F u n c t i o n   M ( )   A s   A ( O f   T ) 
 
                         E n d   F u n c t i o n 
 
 
 
                         P r o t e c t e d   N o t O v e r r i d a b l e   O v e r r i d e s   F u n c t i o n   N ( )   A s   B ( O f   A ( O f   T ) ,   A ( O f   T ) ) 
 
                         E n d   F u n c t i o n 
 
 
 
                         S h a r e d   S h a d o w s   F u n c t i o n   O ( )   A s   A ( O f   T ) 
 
                         E n d   F u n c t i o n 
 
                 E n d   C l a s s 
 
         E n d   N a m e s p a c e 
 
 E n d   N a m e s p a c e 
 
 
 
 N a m e s p a c e   B o o 
 
 
 
         P u b l i c   C l a s s   B a r ( O f   T   A s   I C o m p a r a b l e ) 
 
 
 
                 P u b l i c   f   A s   T 
 
 
 
                 P u b l i c   C l a s s   F o o ( O f   U ) 
 
                         I m p l e m e n t s   I E n u m e r a t o r ( O f   T ) 
 
 
 
                         P u b l i c   S u b   M e t h o d ( O f   K   A s   { I L i s t ( O f   V ) ,   I L i s t ( O f   T ) ,   I L i s t ( O f   U ) } ,   V   A s   I L i s t ( O f   K ) ) ( B y V a l   k 1   A s   K ,   B y V a l   t 1   A s   T ,   B y V a l   u 1   A s   U ) 
 
                                 D i m   a   A s   A ( O f   I n t e g e r ) 
 
                         E n d   S u b 
 
 
 
                         P u b l i c   R e a d O n l y   P r o p e r t y   C u r r e n t   A s   T   I m p l e m e n t s   S y s t e m . C o l l e c t i o n s . G e n e r i c . I E n u m e r a t o r ( O f   T ) . C u r r e n t 
 
                                 G e t 
 
                                 E n d   G e t 
 
                         E n d   P r o p e r t y 
 
 
 
                         P u b l i c   R e a d O n l y   P r o p e r t y   C u r r e n t 1   A s   O b j e c t   I m p l e m e n t s   S y s t e m . C o l l e c t i o n s . I E n u m e r a t o r . C u r r e n t 
 
                                 G e t 
 
                                 E n d   G e t 
 
                         E n d   P r o p e r t y 
 
 
 
                         P u b l i c   F u n c t i o n   M o v e N e x t ( )   A s   B o o l e a n   I m p l e m e n t s   S y s t e m . C o l l e c t i o n s . I E n u m e r a t o r . M o v e N e x t 
 
                         E n d   F u n c t i o n 
 
 
 
                         P u b l i c   S u b   R e s e t ( )   I m p l e m e n t s   S y s t e m . C o l l e c t i o n s . I E n u m e r a t o r . R e s e t 
 
                         E n d   S u b 
 
 
 
 # R e g i o n   " I D i s p o s a b l e   S u p p o r t " 
 
                         P r i v a t e   d i s p o s e d V a l u e   A s   B o o l e a n   '   T o   d e t e c t   r e d u n d a n t   c a l l s 
 
 
 
                         '   I D i s p o s a b l e 
 
                         P r o t e c t e d   O v e r r i d a b l e   S u b   D i s p o s e ( B y V a l   d i s p o s i n g   A s   B o o l e a n ) 
 
                                 I f   N o t   M e . d i s p o s e d V a l u e   T h e n 
 
                                         I f   d i s p o s i n g   T h e n 
 
                                         E n d   I f 
 
                                 E n d   I f 
 
 
 
                                 M e . d i s p o s e d V a l u e   =   T r u e 
 
                         E n d   S u b 
 
 
 
                         P u b l i c   S u b   D i s p o s e ( )   I m p l e m e n t s   I D i s p o s a b l e . D i s p o s e 
 
                                 D i s p o s e ( T r u e ) 
 
                                 G C . S u p p r e s s F i n a l i z e ( M e ) 
 
                         E n d   S u b 
 
 # E n d   R e g i o n 
 
                 E n d   C l a s s 
 
         E n d   C l a s s 
 
 E n d   N a m e s p a c e 
 
 
 
 F r i e n d   C l a s s   T e s t 2 
 
 
 
         P r i v a t e   S u b   B a r 3 ( ) 
 
                 D i m   x   =   N e w   B o o . B a r ( O f   I n t e g e r ) . F o o ( O f   O b j e c t ) ( ) 
 
                 x . M e t h o d ( O f   S t r i n g ,   S t r i n g ) ( "   " ,   5 ,   N e w   O b j e c t ( ) ) 
 
                 D i m   q   =   F r o m   i   I n   N e w   I n t e g e r ( )   { 1 ,   2 ,   3 ,   4 }   W h e r e   i   >   5   S e l e c t   i 
 
         E n d   S u b 
 
 
 
         P u b l i c   S h a r e d   W i d e n i n g   O p e r a t o r   C T y p e ( B y V a l   s   A s   S t r i n g )   A s   T e s t 2 
 
                 R e t u r n   N e w   T e s t 2 ( ) 
 
         E n d   O p e r a t o r 
 
 
 
         P u b l i c   S h a r e d   N a r r o w i n g   O p e r a t o r   C T y p e ( B y V a l   s   A s   I n t e g e r )   A s   T e s t 2 
 
                 R e t u r n   N e w   T e s t 2 ( ) 
 
         E n d   O p e r a t o r 
 
 
 
         P u b l i c   f o o   A s   I n t e g e r   =   5 
 
 
 
         P r i v a t e   S u b   B a r 2 ( ) 
 
                 f o o   =   6 
 
                 M e . f o o   =   5 . G e t T y p e ( ) 
 
                 D i m   t   A s   T e s t 2   =   " s s s " 
 
         E n d   S u b 
 
 
 
         P r i v a t e   S u b   B l a h ( ) 
 
                 D i m   i   A s   I n t e g e r   =   5 
 
                 D i m   j ?   A s   I n t e g e r   =   6 
 
                 D i m   e   A s   E x p r e s s i o n ( O f   F u n c ( O f   I n t e g e r ) )   =   F u n c t i o n ( )   i 
 
         E n d   S u b 
 
 
 
         P u b l i c   P r o p e r t y   F F o o ( )   A s   T y p e 
 
                 G e t 
 
                         R e t u r n   G e t T y p e ( S y s t e m . I n t 3 2 ) 
 
                 E n d   G e t 
 
 
 
                 S e t ( B y V a l   v a l u e   A s   T y p e ) 
 
                         D i m   t   =   G e t T y p e ( S y s t e m . I n t 3 2 ) 
 
                         t . T o S t r i n g ( ) 
 
                         t   =   v a l u e 
 
                 E n d   S e t 
 
         E n d   P r o p e r t y 
 
 
 
         P u b l i c   S u b   C o n s t a n t s ( ) 
 
                 D i m   i   A s   I n t e g e r   =   1   +   2   +   3   +   5 
 
                 D i m   s   A s   G l o b a l . S y s t e m . S t r i n g   =   " a "   &   C S t r ( " a " )   &   " a "   &   " a "   &   " a "   &   " A " 
 
         E n d   S u b 
 
 
 
         P u b l i c   S u b   C o n s t r u c t e d T y p e ( ) 
 
                 D i m   i   A s   L i s t ( O f   I n t e g e r )   =   N o t h i n g 
 
                 D i m   c   A s   I n t e g e r   =   i . C o u n t 
 
         E n d   S u b 
 
 E n d   C l a s s 
 
 
 
 N a m e s p a c e   C o m m e n t s . X m l C o m m e n t s . U n d o c u m e n t e d K e y w o r d s 
 
 
 
         ' ' '   < s u m m a r y > 
 
         ' ' '   W h a t e v e r   
 
         ' ' '   < / s u m m a r y > 
 
         ' ' '   < ! - -   c   - - >   
 
         ' ' '   < ! [ C D A T A [ c ] ] >     / / 
 
         ' ' '   < c > < / c >   / *   * / 
 
         ' ' '   < c o d e > < / c o d e > 
 
         ' ' '   < e x a m p l e > < / e x a m p l e > 
 
         ' ' '   < e x c e p t i o n   c r e f = " b l a " > < / e x c e p t i o n > 
 
         ' ' '   < i n c l u d e   f i l e = ' ' p a t h = ' [ @ n a m e = " " ] ' / >   
 
         ' ' '   < p e r m i s s i o n   c r e f = "   " > < / p e r m i s s i o n > 
 
         ' ' '   < r e m a r k s > < / r e m a r k s > 
 
         ' ' '   < s e e   c r e f = " " / >   
 
         ' ' '   < s e e a l s o   c r e f = "   " / >   
 
         ' ' '   < v a l u e > < / v a l u e > 
 
         ' ' '   < t y p e p a r a m   n a m e = " T " > < / t y p e p a r a m > 
 
         C l a s s   c ( O f   T ) 
 
 
 
                 S u b   M ( O f   U ) ( B y V a l   T 1   A s   T ,   B y V a l   U 1   A s   U ) 
 
                         D i m   i n t V a l u e   A s   I n t e g e r   =   0 
 
                         i n t V a l u e   =   i n t V a l u e   +   1 
 
                         D i m   s t r V a l u e   A s   S t r i n g   =   " h e l l o "   ' s 
 
                         D i m   c   A s   N e w   [ M y C l a s s ] ( ) 
 
                         D i m   v e r b a t i m S t r   A s   S t r i n g   =   " @   \ \ \ \ "   ' s 
 
                 E n d   S u b 
 
         E n d   C l a s s 
 
 E n d   N a m e s p a c e 
 
 
 
 F r i e n d   C l a s s   T e s t C l a s s X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X   ' S c e n 8 
 
 
 
 E n d   C l a s s 
 
 
 
 F r i e n d   C l a s s   T e s t C l a s s 1 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 2 2   ' S c e n 9 
 
 
 
 E n d   C l a s s 
 
 
 
 F r i e n d   C l a s s   y i e l d 
 
 
 
         ' ' I N S T A N T   V B   T O D O   T A S K :   T h e r e   i s   n o   e q u i v a l e n t   t o   t h e   u n d o c u m e n t e d   C #   ' _ _ a r g l i s t '   k e y w o r d   i n   V B : 
 
         ' P r i v a t e   S u b   F o o ( O f   U ) ( B y V a l   _ _ a r g l i s t ) 
 
         '         D i m   c 1   A s   C ( O f   U )   =   N o t h i n g 
 
         '         c 1 . M ( O f   I n t e g e r ) ( 5 ,   N o t h i n g ) 
 
         '         D i m   t r   A s   T y p e d R e f e r e n c e   =   _ _ m a k e r e f ( c 1 ) 
 
         '         D i m   t   A s   T y p e   =   _ _ r e f t y p e ( t r ) 
 
         '         	 D i m   j   A s   I n t e g e r   =   _ _ r e f v a l u e ( t r ,   I n t e g e r ) 
 
         '         P a r a m s ( a : = t ,   b : = t ) 
 
         ' E n d   S u b 
 
         P r i v a t e   S u b   P a r a m s ( B y R e f   a   A s   O b j e c t ,   < S y s t e m . R u n t i m e . I n t e r o p S e r v i c e s . O u t ( ) >   B y R e f   b   A s   O b j e c t ,   B y V a l   P a r a m A r r a y   c ( )   A s   O b j e c t ) 
 
         E n d   S u b 
 
 
 
         ' P r i v a t e   S u b   P a r a m s ( O p t i o n a l   < S y s t e m . R u n t i m e . I n t e r o p S e r v i c e s . O u t ( ) >   B y R e f   a   A s   d y n a m i c   =   2 ,   O p t i o n a l   B y R e f   c   A s   d y n a m i c   =   N o t h i n g ,   P a r a m A r r a y   B y V a l   c ( ) ( )   A s   d y n a m i c ) 
 
         ' E n d   S u b 
 
         P u b l i c   O v e r r i d e s   F u n c t i o n   T o S t r i n g ( )   A s   S t r i n g 
 
                 R e t u r n   M y B a s e . T o S t r i n g ( ) 
 
         E n d   F u n c t i o n 
 
 
 
         P u b l i c   S u b   m e t h o d ( ) 
 
                 D i m   a ? ( 4 )   A s   I n t e g e r   ' [ ]   b u g 
 
                 '   Y E S   [ ] 
 
                 D i m   v a r ( )   A s   I n t e g e r   =   { 1 ,   2 ,   3 ,   4 ,   5 }   ' , ; 
 
                 D i m   i   A s   I n t e g e r   =   a ( i )   ' [ ] 
 
                 D i m   f   A s   N e w   F o o ( O f   T ) ( )   ' < >   ( ) 
 
                 f . m e t h o d ( ) 
 
                 i   =   i   +   i   -   i   *   i   \   i   M o d   i   A n d   i   O r   i   X o r   i   ' +   -   *   /   %   &   |   ^ 
 
                 D i m   b   A s   B o o l e a n   =   T r u e   A n d   F a l s e   O r   T r u e   X o r   F a l s e   ' &   |   ^ 
 
                 b   =   N o t   b   ' ! 
 
                 i   =   N o t   i   ' ~ i 
 
                 b   =   i   <   i   A n d A l s o   i   >   i   ' <   & &   > 
 
                 D i m   i i ?   A s   I n t e g e r   =   5   ' ?   b u g 
 
                 '   N O   ? 
 
                 D i m   f 1   A s   I n t e g e r   =   I f ( T r u e ,   1 ,   0 )   ' ?   : 
 
                 '   Y E S   : 
 
                 i   + =   1   ' + + 
 
                 i   - =   1   ' - - 
 
                 b   =   T r u e   A n d A l s o   F a l s e   O r E l s e   T r u e   ' & &   | | 
 
                 i   =   i   < <   5   ' < < 
 
                 i   =   i   > >   5   ' > > 
 
                 b   =   i   =   i   A n d A l s o   i   < >   i   A n d A l s o   i   < =   i   A n d A l s o   i   > =   i   ' =   = =   & &   ! =   < =   > = 
 
                 i   + =   5 . 0   ' + = 
 
                 i   - =   i   ' - = 
 
                 i   * =   i   ' * = 
 
                 i   \ =   i   ' / 
 
                 ' = 
 
                 i   =   i   M o d   i   ' % = 
 
                 i   =   i   A n d   i   ' & = 
 
                 i   =   i   O r   i   ' | = 
 
                 i   =   i   X o r   i   ' ^ = 
 
                 i   < < =   i   ' < < = 
 
                 i   > > =   i   ' > > = 
 
                 D i m   s   A s   O b j e c t   =   F u n c t i o n ( x )   x   +   1   ' = > 
 
                 '   T h e r e   i s   n o   e q u i v a l e n t   t o   a n   ' u n s a f e '   b l o c k   i n   V B . N E T 
 
                 ' 	 	 	 u n s a f e 
 
                 ' 	 	 P o i n t *   p   =   & p o i n t   ' *   & 
 
                 ' 	 	 	 p - > x   =   1 0   ' - > 
 
                 D i m   p   A s   P o i n t 
 
                 p . X   =   1 0 
 
                 p . Y   =   1 2 
 
                 D i m   p 2   A s   N e w   P o i n t   W i t h   { . X   =   1 0 ,   . Y   =   1 2 } 
 
                 D i m   b r   A s   I O . B i n a r y R e a d e r   =   N o t h i n g 
 
         E n d   S u b 
 
 
 
         F r i e n d   S t r u c t u r e   P o i n t 
 
 
 
                 P u b l i c   X   A s   I n t e g e r 
 
 
 
                 P u b l i c   Y   A s   I n t e g e r 
 
         E n d   S t r u c t u r e 
 
 E n d   C l a s s 
 
 
 
 ' E x t e n s i o n   M e t h o d 
 
 M o d u l e   M o d u l e 1 
 
         < R u n t i m e . C o m p i l e r S e r v i c e s . E x t e n s i o n ( ) > 
 
         F u n c t i o n   F o o E x t e n s i o n ( B y V a l   x   A s   S t r i n g )   A s   S t r i n g 
 
                 R e t u r n   x   &   " t e s t " 
 
         E n d   F u n c t i o n 
 
 
 
         < R u n t i m e . C o m p i l e r S e r v i c e s . E x t e n s i o n ( ) > 
 
         F u n c t i o n   F o o E x t e n s i o n ( B y V a l   x   A s   S t r i n g ,   B y V a l   y   A s   I n t e g e r )   A s   S t r i n g 
 
                 ' W i t h   I m p l i c i t   L i n e   C o n t i n u a t i o n 
 
                 R e t u r n   x   &   " t e s t 2 " 
 
         E n d   F u n c t i o n 
 
 
 
         S u b   F o o ( ) 
 
                 ' C o l l e c t i o n s 
 
                 D i m   i   A s   N e w   L i s t ( O f   S t r i n g )   F r o m   { " t e s t " ,   " i t e m " } 
 
                 D i m   i 1   A s   N e w   D i c t i o n a r y ( O f   I n t e g e r ,   S t r i n g )   F r o m   { { 1 ,   " t e s t " } ,   { 2 ,   " i t e m " } } 
 
                 ' A r r a y s 
 
                 D i m   i a 1   =   { 1 ,   2 ,   3 ,   4 ,   5 } 
 
                 D i m   l a 2   =   { 1 ,   2 L ,   3 ,   4 S ,   5 } 
 
                 C o n s o l e . W r i t e ( G e t X m l N a m e s p a c e ( n s ) ) 
 
                 D i m   i a 3   A s   I n t e g e r ( )   =   { 1 ,   2 ,   3 ,   4 ,   5 } 
 
                 D i m   i a 4 ( )   A s   I n t e g e r   =   { 1 ,   2 ,   3 ,   4 ,   5 } 
 
                 D i m   i a 5   =   N e w   I n t e g e r ( )   { 1 ,   2 ,   3 ,   4 ,   5 } 
 
                 D i m   i a 6   =   { { 1 ,   2 } ,   { 3 ,   4 } ,   { 5 ,   6 } }   ' 2 d   a r r a y 
 
                 D i m   i a 7   =   { ( { 1 } ) ,   ( { 3 ,   4 } ) ,   ( { 5 ,   6 ,   2 } ) }   ' j a g g e d   a r r a y 
 
                 ' S t a n d a l o n e 
 
                 I f   { 1 ,   2 ,   3 } . C o u n t   =   2   T h e n 
 
                 E l s e I f   { 1 ,   2 ,   3 } . C o u n t   =   3   T h e n 
 
                 E l s e 
 
                 E n d   I f 
 
         E n d   S u b 
 
 E n d   M o d u l e 
 
 
 
 # R e g i o n   " E v e n t s " 
 
 P u b l i c   D e l e g a t e   S u b   M y D e l e g a t e ( B y V a l   m e s s a g e   A s   S t r i n g ) 
 
 C l a s s   M y C l a s s 1 
 
 
 
         C u s t o m   E v e n t   M y E v e n t   A s   M y D e l e g a t e 
 
                 '   T h i s   c o d e   w i l l   b e   r u n   w h e n   A d d H a n d l e r   M y E v e n t ,   D 1 
 
                 '   i s   c a l l e d 
 
                 A d d H a n d l e r ( B y V a l   v a l u e   A s   M y D e l e g a t e ) 
 
                         C o n s o l e . W r i t e L i n e ( " A d d i n g   H a n d l e r   f o r   M y E v e n t " ) 
 
                         M y E v e n t H a n d l e r   =   v a l u e 
 
                 E n d   A d d H a n d l e r 
 
 
 
                 '   T h i s   c o d e   w i l l   b e   r u n   w h e n   R e m o v e H a n d l e r   M y E v e n t ,   D 1 
 
                 '   i s   c a l l e d 
 
                 R e m o v e H a n d l e r ( B y V a l   v a l u e   A s   M y D e l e g a t e ) 
 
                         C o n s o l e . W r i t e L i n e ( " R e m o v i n g   H a n d l e r   f o r   M y E v e n t " ) 
 
                         M y E v e n t H a n d l e r   =   N o t h i n g 
 
                 E n d   R e m o v e H a n d l e r 
 
 
 
                 '   T h i s   c o d e   w i l l   b e   r u n   w h e n   R a i s e E v e n t   M y E v e n t ( s t r i n g ) 
 
                 '   i s   c a l l e d 
 
                 R a i s e E v e n t ( B y V a l   m e s s a g e   A s   S t r i n g ) 
 
                         I f   N o t   M y E v e n t H a n d l e r   I s   N o t h i n g   T h e n 
 
                                 M y E v e n t H a n d l e r . I n v o k e ( m e s s a g e ) 
 
                         E l s e 
 
                                 C o n s o l e . W r i t e L i n e ( " N o   H a n d l e r   f o r   R a i s e d   M y E v e n t " ) 
 
                         E n d   I f 
 
                 E n d   R a i s e E v e n t 
 
         E n d   E v e n t 
 
 
 
         P u b l i c   M y E v e n t H a n d l e r   A s   M y D e l e g a t e 
 
 
 
         P u b l i c   S u b   R a i s e _ E v e n t ( ) 
 
                 R a i s e E v e n t   M y E v e n t ( " M y E v e n t   W a s   R a i s e d " ) 
 
         E n d   S u b 
 
 E n d   C l a s s 
 
 
 
 M o d u l e   D e l e g a t e M o d u l e 
 
         D i m   V a r 1   A s   M y C l a s s 1 
 
         D i m   D 1   A s   M y D e l e g a t e 
 
         S u b   E v e n t s M a i n ( ) 
 
                 V a r 1   =   N e w   M y C l a s s 1 
 
                 D 1   =   N e w   M y D e l e g a t e ( A d d r e s s O f   M y H a n d l e r ) 
 
                 A d d H a n d l e r   V a r 1 . M y E v e n t ,   D 1 
 
                 V a r 1 . R a i s e _ E v e n t ( ) 
 
                 R e m o v e H a n d l e r   V a r 1 . M y E v e n t ,   D 1 
 
         E n d   S u b 
 
 
 
         S u b   M y H a n d l e r ( B y V a l   m e s s a g e   A s   S t r i n g ) 
 
                 C o n s o l e . W r i t e L i n e ( " E v e n t   H a n d l e d :   "   &   m e s s a g e ) 
 
         E n d   S u b 
 
 E n d   M o d u l e 
 
 
 
 # E n d   R e g i o n 
 
 # R e g i o n   " L i n q " 
 
 M o d u l e   L I N Q Q u e r i e s 
 
         S u b   J o i n ( ) 
 
                 D i m   c a t e g o r i e s ( )   =   { " B e v e r a g e s " ,   " C o n d i m e n t s " ,   " V e g e t a b l e s " ,   " D a i r y   P r o d u c t s " ,   " S e a f o o d " } 
 
                 D i m   p r o d u c t L i s t   =   { N e w   W i t h   { . c a t e g o r y   =   " C o n d i m e n t s " ,   . n a m e   =   " K e t c h u p " } ,   N e w   W i t h   { . c a t e g o r y   =   " S e a f o o d " ,   . n a m e   =   " C o d e " } } 
 
                 D i m   q u e r y   =   F r o m   c   I n   c a t e g o r i e s   G r o u p   J o i n   p   I n   p r o d u c t L i s t   O n   c   E q u a l s   p . c a t e g o r y   I n t o       G r o u p   F r o m   p   I n   G r o u p   S e l e c t   C a t e g o r y   =   c ,   p . n a m e 
 
                 F o r   E a c h   v   I n   q u e r y 
 
                         C o n s o l e . W r i t e L i n e ( v . n a m e   +   " :   "   +   v . C a t e g o r y ) 
 
                 N e x t 
 
 
 
         E n d   S u b 
 
 E n d   M o d u l e 
 
 
 
 # E n d   R e g i o n 
 
 # R e g i o n   " L a m b d a ' s " 
 
 M o d u l e   L a m b d a s 
 
         D i m   l 1   =   S u b ( ) 
 
                 C o n s o l e . W r i t e L i n e ( " S u b   S t a t e m e n t " ) 
 
         E n d   S u b 
 
 
 
         D i m   L 2   =   S u b ( )   C o n s o l e . W r i t e L i n e ( " S u b   S t a t e m e n t   2 " ) 
 
         D i m   L 3   =   F u n c t i o n ( x   A s   I n t e g e r )   x   M o d   2 
 
         D i m   L 4   =   F u n c t i o n ( y   A s   I n t e g e r )   A s   B o o l e a n 
 
                 I f   y   *   2   <   1 0   T h e n 
 
                         R e t u r n   T r u e 
 
                 E l s e 
 
                         R e t u r n   F a l s e 
 
                 E n d   I f 
 
         E n d   F u n c t i o n 
 
 E n d   M o d u l e 
 
 
 
 # E n d   R e g i o n 
 
 # R e g i o n   " C o   C o n t r a   V a r i a n c e " 
 
 P u b l i c   C l a s s   C h e e t a h 
 
 
 
 E n d   C l a s s 
 
 
 
 P u b l i c   C l a s s   A n i m a l s 
 
 
 
 E n d   C l a s s 
 
 
 
 P u b l i c   I n t e r f a c e   I V a r i a n c e ( O f   I n   T ) 
 
 
 
         S u b   F o o ( B y V a l   a   A s   T ) 
 
 
 
         P r o p e r t y   I n t e r P r o p e r t y ( )   A s   I V a r i a n c e ( O f   C h e e t a h ) 
 
 
 
         P r o p e r t y   I n t e r P r o p e r t y 2 ( )   A s   I V a r i a n c e ( O f   A n i m a l s ) 
 
 
 
 E n d   I n t e r f a c e 
 
 
 
 D e l e g a t e   S u b   F u n c ( O f   I n   T ) ( B y V a l   a   A s   T ) 
 
 P u b l i c   D e l e g a t e   F u n c t i o n   F u n c 2 ( O f   O u t   T ) ( )   A s   T 
 
 P u b l i c   I n t e r f a c e   I V a r i a n c e 2 ( O f   O u t   T ) 
 
 
 
         F u n c t i o n   F o o ( )   A s   T 
 
 
 
 E n d   I n t e r f a c e 
 
 
 
 P u b l i c   C l a s s   V a r i a n c e 2 ( O f   T   A s   N e w )   :   I m p l e m e n t s   I V a r i a n c e 2 ( O f   T ) 
 
 
 
         D i m   t y p e   A s   I V a r i a n c e 2 ( O f   A n i m a l s ) 
 
 
 
         P u b l i c   F u n c t i o n   F o o ( )   A s   T   I m p l e m e n t s   I V a r i a n c e 2 ( O f   T ) . F o o 
 
                 R e t u r n   N e w   T 
 
         E n d   F u n c t i o n 
 
 
 
         F u n c t i o n   F o o ( B y V a l   a r g   A s   I V a r i a n c e 2 ( O f   T ) )   A s   S t r i n g 
 
                 R e t u r n   a r g . G e t T y p e . T o S t r i n g 
 
         E n d   F u n c t i o n 
 
 
 
         F u n c t i o n   G o o ( B y V a l   a r g   A s   F u n c 2 ( O f   T ) )   A s   S t r i n g 
 
                 R e t u r n   a r g . I n v o k e ( ) . G e t T y p e . T o S t r i n g 
 
         E n d   F u n c t i o n 
 
 E n d   C l a s s 
 
 
 
 # E n d   R e g i o n 
 
 M o d u l e   M o d 1 O r c a s 
 
         D i m   A T 1   =   N e w   W i t h   { K e y   . p r o p 1   =   1 } 
 
         D i m   A T 2   =   N e w   W i t h   { . p r o p 1   =   7 } 
 
         D i m   b _ f a l s e   A s   B o o l e a n   =   F a l s e 
 
         D i m   n _ f a l s e   =   F a l s e 
 
         D i m   i   =   I f ( b _ f a l s e   A n d   n _ f a l s e ,   1 ,   2 ) 
 
         D i m   s 1   =   < x m l _ l i t e r a l > < % =   I f ( N o t h i n g ,   N o t h i n g )   % > < / x m l _ l i t e r a l > 
 
         D e l e g a t e   S u b   d e l f o o ( ) 
 
         D e l e g a t e   S u b   d e l f o o 1 ( B y V a l   s e n d e r   A s   O b j e c t ,   B y V a l   e   A s   S y s t e m . E v e n t A r g s ) 
 
         S u b   F o o ( ) 
 
         E n d   S u b 
 
 
 
         S u b   M e t h o d 1 ( B y V a l   s e n d e r   A s   O b j e c t ,   B y V a l   e   A s   S y s t e m . E v e n t A r g s ) 
 
         E n d   S u b 
 
 
 
         S u b   M e t h o d 1 a ( ) 
 
         E n d   S u b 
 
 
 
         S u b   A s s i g n D e l e g a t e ( ) 
 
                 D i m   d   A s   d e l f o o   =   A d d r e s s O f   F o o 
 
                 d . I n v o k e ( ) 
 
                 D i m   d 1 _ 1   A s   d e l f o o 1   =   A d d r e s s O f   M e t h o d 1 
 
                 D i m   d 1 _ 1 a   A s   d e l f o o 1   =   A d d r e s s O f   M e t h o d 1 a   ' R e l a x e d   D e l e g a t e 
 
                 ' N u l l a b l e 
 
                 D i m   V a l u e 1 a   A s   I n t e g e r ?   =   1 0 
 
                 D i m   V a l u e 1 b   A s   I n t e g e r   =   1 
 
                 D i m   V a l u e 1 c ?   A s   I n t e g e r   =   1 
 
                 D i m   V a l u e 1 c ?   A s   I n t e g e r ?   =   1 
 
                 D i m   T e s t R e t u r n V a l u e   =   V a l u e 1 a   *   V a l u e 1 b 
 
                 I f   V a l u e 1 a   /   V a l u e 1 b   >   0   T h e n 
 
                 E n d   I f 
 
 
 
                 D i m   s N o n e   =   " N o n e " 
 
                 D i m   S S y s t e m O n l y   =   " S y s t e m O n l y " 
 
                 D i m   X M L L i t e r a l   =   < ? x m l   v e r s i o n   = " 1 . 0 " e n c o d i n g   = " u t f - 8 " ? >   < D e t a i l s > < F i l e I m p o r t s > < F i l e I m p o r t   n a m e = < % =   s N o n e   % > > < / F i l e I m p o r t > < F i l e I m p o r t   n a m e = < % =   S S y s t e m O n l y   % > > 
 
                 I m p o r t s   S y s t e m 
 
             < / F i l e I m p o r t > < F i l e I m p o r t   n a m e = " D e f a u l t " > 
 
                 I m p o r t s   S y s t e m 
 
                 I m p o r t s   S y s t e m . C o l l e c t i o n s 
 
             < / F i l e I m p o r t > < / F i l e I m p o r t s > < C o d e C o n s t r u c t s > < ! - -   T y p e   C o n s t r u c t s - - >   < C o n s t r u c t   n a m e = " M o d u l e " a l l o w c o d e b l o c k = " f a l s e " a l l o w O u t e r = " t r u e " g r o u p = " T y p e " a l l o w n e s t i n g = " t r u e " i s n e s t a b l e = " f a l s e " a l l o w s o v e r l o a d = " f a l s e " > < S t a r t > p u b l i c   M o d u l e   { I d e n t i f i e r } < / S t a r t > < E n d > E n d   M o d u l e   < / E n d > < D e f a u l t I d e n t > M o d u l e _ < / D e f a u l t I d e n t > < / C o n s t r u c t > < C o n s t r u c t   n a m e = " C l a s s " a l l o w c o d e b l o c k = " f a l s e " a l l o w O u t e r = " t r u e " g r o u p = " T y p e " a l l o w n e s t i n g = " t r u e " i s n e s t a b l e = " t r u e " a l l o w s o v e r l o a d = " f a l s e " > < S t a r t > p u b l i c   c l a s s   { I d e n t i f i e r } < / S t a r t > < E n d > E n d   C l a s s < / E n d > < D e f a u l t I d e n t > C l a s s _ < / D e f a u l t I d e n t > < / C o n s t r u c t > < C o n s t r u c t   n a m e = " S t r u c t u r e " a l l o w c o d e b l o c k = " f a l s e " a l l o w O u t e r = " t r u e " g r o u p = " T y p e " a l l o w n e s t i n g = " t r u e " i s n e s t a b l e = " t r u e " a l l o w s o v e r l o a d = " f a l s e " > < S t a r t > p u b l i c   c l a s s   { I d e n t i f i e r } < / S t a r t > < E n d > E n d   C l a s s < / E n d > < D e f a u l t I d e n t > S t r u c t _ < / D e f a u l t I d e n t > < / C o n s t r u c t > < / C o d e C o n s t r u c t s > < C o d e B l o c k s > < B l o c k   n a m e = " C o d e B l o c k 0 . t x t " s t a t e m e n t s = " 1 " > < ! [ C D A T A [   D i m   < { x 0 } >   =   M i c r o s o f t . V i s u a l B a s i c . F i l e S y s t e m . D i r ( " . " )   ] ] > < / B l o c k > < B l o c k   n a m e = " C o d e B l o c k 1 . t x t " s t a t e m e n t s = " 1 " > < ! [ C D A T A [   D i m   < { x 0 } >   =   1   ] ] > < / B l o c k > < B l o c k   n a m e = " C o d e B l o c k 2 . t x t " s t a t e m e n t s = " 1 " > < ! [ C D A T A [   D i m   < { x 0 } >   a s   s t r i n g   =   " 2 "   ] ] > < / B l o c k > < / C o d e B l o c k s > < / D e t a i l s > 
 
                 D i m   x   =   < ! [ C D A T A [   D i m   < { x 0 } >   a s   s t r i n g   =   " 2 "   ] ] > 
 
                 D i m   y   =   < ! - -   - - >   :   C a l l   < ? a   ? > ( )   :   D i m   x   =   < e / > 
 
         E n d   S u b 
 
 E n d   M o d u l e 
 
 
 
 C l a s s   C u s t o m e r 
 
 
 
         P u b l i c   P r o p e r t y   n a m e   A s   S t r i n g   =   " D e f a u l t " 
 
 
 
         P u b l i c   A G e   A s   I n t e g e r 
 
 
 
         P u b l i c   P o s t i o n   A s   S t r i n g 
 
 
 
         P u b l i c   L e v e l   A s   I n t e g e r   =   0 
 
 
 
         P u b l i c   P r o p e r t y   a g e 2   A s   I n t e g e r 
 
 E n d   C l a s s 
 
 
 
 C l a s s   F o o 
 
 
 
         S t r u c t u r e   B a r 
 
 
 
                 D i m   x   A s   I n t e g e r 
 
 
 
                 S u b   L o o p i n g M e t h o d ( ) 
 
                         F o r   i   =   1   T o   2 0   S t e p   1 
 
                         N e x t   i 
 
 
 
                         F o r   E a c h   a   I n   { 1 ,   2 ,   3 ,   4 } 
 
                         N e x t 
 
 
 
                         D i m   i c o u n t   A s   I n t e g e r 
 
                         D o   W h i l e   i c o u n t   < =   1 0 
 
                                 i c o u n t   + =   1 
 
                         L o o p 
 
 
 
                         i c o u n t   =   0 
 
                         W h i l e   i c o u n t   < =   1 0 0 
 
                                 i c o u n t   + =   1 
 
                         E n d   W h i l e 
 
 
 
                         i c o u n t   =   0 
 
                         D o   U n t i l   i c o u n t   > =   1 0 
 
                                 i c o u n t   + =   2 
 
                         L o o p 
 
 
 
                 E n d   S u b 
 
         E n d   S t r u c t u r e 
 
 E n d   C l a s s 
 
 
 
 C l a s s   F o o G e n ( O f   t ) 
 
 
 
         S t r u c t u r e   B a r G e n ( O f   u ) 
 
 
 
                 D i m   x   A s   t 
 
 
 
                 D i m   z   A s   u 
 
 
 
                 S u b   S e l e c t i o n M e t h o d s ( ) 
 
                         D i m   i c o u n t   A s   I n t e g e r   =   1 L 
 
                         I f   i c o u n t   =   1   T h e n 
 
                         E l s e I f   i c o u n t   >   1   T h e n 
 
                         E l s e 
 
                         E n d   I f 
 
 
 
                         S e l e c t   C a s e   i c o u n t 
 
                                 C a s e   1 
 
                                 C a s e   2 ,   3 
 
                                 C a s e   I s   >   3 
 
                                 C a s e   E l s e 
 
                         E n d   S e l e c t 
 
                 E n d   S u b 
 
 
 
                 S u b   O p e r a t o r s ( ) 
 
                         D i m   a   A s   B o o l e a n   =   T r u e 
 
                         D i m   b   A s   B o o l e a n   =   F a l s e 
 
                         I f   a   A n d   b   T h e n 
 
                         E n d   I f 
 
 
 
                         I f   a   O r   b   T h e n 
 
                         E n d   I f 
 
 
 
                         I f   N o t   a   A n d   b   T h e n 
 
                         E n d   I f 
 
 
 
                         I f   a   =   b   A n d A l s o   b   =   T r u e   T h e n 
 
                         E n d   I f 
 
 
 
                         I f   a   =   b   O r E l s e   b   =   F a l s e   T h e n 
 
                         E n d   I f 
 
 
 
                         I f ( a   O r   b )   O r E l s e   b   =   T r u e   T h e n 
 
                         E n d   I f 
 
                 E n d   S u b 
 
 
 
                 S u b   M e t h o d 1 ( ) 
 
                         D i m   x   A s   N e w   C u s t o m e r   W i t h   { . n a m e   =   " T e s t " ,   . A G e   =   3 0 ,   . L e v e l   =   1 ,   . P o s t i o n   =   " S D E T " } 
 
                         D i m   x 2   A s   N e w   C u s t o m e r   W i t h   { . n a m e   =   " T e s t " ,   . A G e   =   3 0 ,   . L e v e l   =   1 ,   . P o s t i o n   =   " S D E T " ,   . a g e 2   = . A G e } 
 
                 E n d   S u b 
 
         E n d   S t r u c t u r e 
 
 E n d   C l a s s 
 
 
 
 P u b l i c   C l a s s   B a r 
 
 
 
 E n d   C l a s s 
 
 
 
 P u b l i c   C l a s s   C l s P P M T e s t 0 0 3 
 
 
 
         P a r t i a l   P r i v a t e   S u b   F o o 3 ( ) 
 
         E n d   S u b 
 
 E n d   C l a s s 
 
 
 
 P a r t i a l   P u b l i c   C l a s s   C l s P P M T e s t 0 0 3 
 
 
 
         P r i v a t e   S u b   F o o 3 ( ) 
 
         E n d   S u b 
 
 
 
         P u b l i c   S u b   C a l l F o o F r o m C l a s s ( ) 
 
                 M e . F o o 3 ( ) 
 
                 D i m   x 1   A s   N e w   F o o 
 
                 D i m   y 1   A s   N e w   B a r 
 
                 I f   x 1   I s   y 1   T h e n 
 
                 E l s e 
 
                         C o n s o l e . W r i t e L i n e ( " E x p e c t e d   R e s u l t   O c c u r r e d " ) 
 
                 E n d   I f 
 
 
 
                 I f   x 1   I s N o t   y 1   T h e n 
 
                 E l s e 
 
                         C o n s o l e . W r i t e L i n e ( " E x p e c t e d   R e s u l t   O c c u r r e d " ) 
 
                 E n d   I f 
 
         E n d   S u b 
 
 E n d   C l a s s 
 
 