Niezalogowany (Zaloguj się)
WItaj Gościu! Możesz się teraz zalogować lub poprosić o członkowstwo na Forum Turbo Pascal Web Pag
    • CommentAuthorDaniel131
    • CommentTime26 Apr 2009 zmieniony
     
    Witam. czy mógłby mi ktoś pomóc rozwiązać ten problem? Wydaje mi sie że program jest dobrze napisany a jednak turbo pascal 7.0 wywala błąd "error 22: structure too large' Może mi ktoś poprawić ten kod? uses crt; {Coded by: _OZZY} {Ksiazka telefonicza} var n,m,z:array[1..60000] of string; l,l2:charl gloszenia1:byte; c1:byte dane:test; procedure nowy; {procedura do wprowadzania numeru} Begin ClrScr; gloszenia:=gloszenia1+1; Write('Imie : '); ReadLn( n[gloszenia1] ); Write('Nazwisko : '); ReadLn( m[gloszenia1] ); Write('Telefon : '); ReadLn( z[gloszenia1] ); End; {koniec numeru} procedure pokaz; {procedura wyswietla numerow od 1....n} Begin ClrScr; Write('Numer zgloszenia ? (1..', gloszenia1 ,') :'); ReadLn(t1); WriteLn('Miasta : ',n[c1] ); WriteLn('Miejsca : ',m[c1] ); WriteLn('Zgloszenia : ',z[c1] ); WriteLn; Write('Wcisnij jakis klawisz...'); l2:=readkey; End; {koniec wyswietlania} PROCEDURE save; {procedura zapisu do pliku} Begin Assign(dane,'kol.out'); ReWrite(dane); WriteLn(dane,gloszenia1); c1:=0; Repeat c1:=c1+1; WriteLn(dane,n[c1] ); WriteLn(dane,m[c1] ); WriteLn(dane,z[c1] ); Until c1=gloszenia1; Close(dane); End; {koniec zapisu} PROCEDURE load; {procedura wejscia z pliku} Begin Assign(dane,'kol.out'); Reset(dane); ReadLn(dane,gloszenia1); c1:=0; Repeat c1:=c1+1; ReadLn(dane,n[c1] ); ReadLn(dane,m[c1] ); ReadLn(dane,z[c1] ); Until c1=gloszenia1; Close(dane); End; {koniec wejscia} Begin {czes glowna "menu"} gloszenia1:=0; Repeat ClrScr; WriteLn('1. Nowe zgloszenie'); WriteLn('2. Wyswietlenie zgloszenia'); WriteLn('3. Odczyt zgloszen'); WriteLn('4. Zapis zgloszenia'); WriteLn('5. Koniec programu'); Repeat l:=readkey; Until (l>='1') AND (l<='5'); If l='1' Then nowy; If l='2' Then pokaz; If l='3' Then load; If l='4' Then save; Until l='5'; End. {koniec menu}
    • CommentAuthorDaniel131
    • CommentTime26 Apr 2009
     
    uses crt; {Coded by: _OZZY} {Ksiazka telefonicza} var n,m,z:array[1..60000] of string; l,l2:charl gloszenia1:byte; c1:byte dane:test; procedure nowy; {procedura do wprowadzania numeru} Begin ClrScr; gloszenia:=gloszenia1+1; Write('Imie : '); ReadLn( n[gloszenia1] ); Write('Nazwisko : '); ReadLn( m[gloszenia1] ); Write('Telefon : '); ReadLn( z[gloszenia1] ); End; {koniec numeru} procedure pokaz; {procedura wyswietla numerow od 1....n} Begin ClrScr; Write('Numer zgloszenia ? (1..', gloszenia1 ,') :'); ReadLn(t1); WriteLn('Miasta : ',n[c1] ); WriteLn('Miejsca : ',m[c1] ); WriteLn('Zgloszenia : ',z[c1] ); WriteLn; Write('Wcisnij jakis klawisz...'); l2:=readkey; End; {koniec wyswietlania} PROCEDURE save; {procedura zapisu do pliku} Begin Assign(dane,'kol.out'); ReWrite(dane); WriteLn(dane,gloszenia1); c1:=0; Repeat c1:=c1+1; WriteLn(dane,n[c1] ); WriteLn(dane,m[c1] ); WriteLn(dane,z[c1] ); Until c1=gloszenia1; Close(dane); End; {koniec zapisu} PROCEDURE load; {procedura wejscia z pliku} Begin Assign(dane,'kol.out'); Reset(dane); ReadLn(dane,gloszenia1); c1:=0; Repeat c1:=c1+1; ReadLn(dane,n[c1] ); ReadLn(dane,m[c1] ); ReadLn(dane,z[c1] ); Until c1=gloszenia1; Close(dane); End; {koniec wejscia} Begin {czes glowna "menu"} gloszenia1:=0; Repeat ClrScr; WriteLn('1. Nowe zgloszenie'); WriteLn('2. Wyswietlenie zgloszenia'); WriteLn('3. Odczyt zgloszen'); WriteLn('4. Zapis zgloszenia'); WriteLn('5. Koniec programu'); Repeat l:=readkey; Until (l>='1') AND (l<='5'); If l='1' Then nowy; If l='2' Then pokaz; If l='3' Then load; If l='4' Then save; Until l='5'; End. {koniec menu}