7 APELLIDO = string[MAX_APE];
8 DOCUMENTO = 10000000..40000000;
13 TABLA = array[1..1000] of PERSONA;
14 TIPO_LETRA = ( TL_VOCAL, TL_CONSO );
15 TIPO_VOCAL = ( TV_AEIOU, TV_EI );
16 INDICADOR = ( I_NADA, I_ESB, I_ESC, I_ESF, I_ESG, I_ESL, I_ESM, I_ESN, I_ESQ, I_ESQU, I_ESR, I_EST );
18 (*********************************************************)
20 function GetVocal( tipo: TIPO_VOCAL ): char;
26 if tipo = TV_AEIOU then valor := random( 16 )
27 else valor := random( 6 ) + 5;
29 0..4: GetVocal := 'A';
30 5..7: GetVocal := 'E';
31 8..10: GetVocal := 'I';
32 11..13: GetVocal := 'O';
33 14..15: GetVocal := 'U';
37 (*********************************************************)
39 procedure GetRNDVocal( var indic: INDICADOR; var proxl: TIPO_LETRA; var vocal: char );
54 vocal := GetVocal( TV_EI );
60 vocal := GetVocal( TV_AEIOU );
62 if random( 40 ) = 0 then proxl := TL_VOCAL
63 else proxl := TL_CONSO;
68 (*********************************************************)
70 procedure GetRNDConsonante( var indic: INDICADOR; var proxl: TIPO_LETRA; var conso: char );
80 I_ESF, I_ESR, I_ESG, I_EST: conso := 'R';
81 I_ESB: case random( 2 ) of
85 I_ESC: case random( 4 ) of
91 I_ESL: case random( 6 ) of
95 I_ESM: case random( 3 ) of
100 I_ESN: case random( 3 ) of
105 else case random( 55 ) of
108 if random( 10 ) = 0 then begin
115 if random( 5 ) = 0 then begin
123 if random( 10 ) = 0 then begin
130 if random( 5 ) = 0 then
133 if random( 4 ) = 0 then proxl := TL_CONSO;
136 18..19: conso := 'H';
137 20..22: conso := 'J';
138 23..24: conso := 'K';
141 if random( 15 ) = 0 then
149 if random( 5 ) = 0 then
157 if random( 5 ) = 0 then
163 34..36: conso := 'P';
170 if random( 3 ) = 0 then
176 42..44: conso := 'S';
179 if random( 10 ) = 0 then
185 48..50: conso := 'V';
190 end; { case random( 55 ) of }
192 end; { case indic of }
193 end; { procedimiento }
195 (*********************************************************)
197 function GetRNDApellido( max, min: integer ): APELLIDO;
207 if max > MAX_APE then max := MAX_APE;
208 tam := random( max + 1 ) + min;
211 if random( 5 ) = 0 then proxl := TL_VOCAL
212 else proxl := TL_CONSO;
215 if proxl = TL_CONSO then GetRNDConsonante( indic, proxl, aux )
216 else GetRNDVocal( indic, proxl, aux );
219 GetRNDApellido := apel;
231 assign( arch, 'DATOS.TXT' );
233 dni := 10000000 + (random( 15000 ) * 100);
237 ap := GetRNDApellido( 7, 4 );
238 dni := dni + random( 50000 ) + 1;
240 writeln( arch, dni );