uses crt,dos,infkeret; var legvege:char; nepsuruseg:real; klm:boolean; {Kell-e menteni?} c:char; {Mentes vagy visszaallitas?} type TMinden=record hol:St; mxi,mxj:integer; cse,le:boolean; t:tomb; p:paramt; h:hullt; end; var minden:TMinden; sfile:file of Tminden; procedure mentes_vallit(mi:char; var klm:boolean; var minden:Tminden); var f:file of Tminden; fnev:string[12]; fhely:PathStr; {ior:integer; {ioresult} begin if ( mi='M' ) then begin repeat write('K‚rem a kimeneti file nev‚t (8): '); readln(fnev); until (length(fnev) in [1..8]); fnev:=fnev+'.dat'; assign(f,fnev); {$I-} rewrite(f); write(f,minden); {$I+} close(f); klm:=false; end {if} else if ( mi='V' ) then begin {Nem mukodik rendesen!} (* repeat repeat write('K‚rem a bemeneti file nev‚t (8): '); readln(fnev); until (length(fnev) in [1..8]); fnev:=fnev+'.dat'; assign(f,fnev); fhely:=FSearch(fnev,GetEnv('PATH')); until (FExpand(fhely)<>''); reset(f); {$I-} read(f,minden); ior:=ioresult; {$I+} close(f); *) end; {else} end; begin klm:=false; repeat randomize; with minden do begin foprogram(' Szimul ci¢ ','Demogr fiai modell','Korcsoportonk‚nti sz zal‚kos megoszl s:',hol,mxi,mxj,cse,le,klm,t,p,h); {(focim,alcim,grafcim:string; hol:St; mxi,mxj, cse,le, T:Tomb; P:ParamT)} end; if klm then begin write('Ment (vagy Visszaallit)? '); readln(c); c:=upcase(c); if ((c='M') or (c='V')) then mentes_vallit(c,klm,minden); legvege:='k'; end else begin write('Ism‚t? (ak r m s adatokkal) '); readln(legvege); klm:=false; end; until (upcase(legvege)='N'); end.