sintassi varia con turbo pascal 1.1 su mac
program fonti; { funzioni standard ,senza SANE} { attivazione librerie per gestione varie FONT,dimensioni,stili }
uses memtypes,quickdraw;
begin textfont(0); textsize(12); textface([bold]); writeln(abs(-6)); writeln(sqr(5)); writeln(sqrt(100)); writeln(exp(3)); writeln(ln(100)); writeln(round(123.56)); writeln(trunc(123.654)); writeln(int(123.76)); writeln('-----------------------'); readln; textface([italic]); writeln(sin(30*3.14/180)); writeln(cos(2)); writeln(arctan(2)); writeln('-----------------------'); textface([outline]); writeln(sin(2)/cos(2)); writeln(cos(2)/sin(2)); writeln(1.0/cos(2)); writeln(1.0/sin(2)); writeln('----------------------'); readln; textface([shadow]); writeln(HI(256)); writeln(LO(256)); writeln(swap(17341)); writeln('----------------------'); writeln(pred(10)); writeln(pred('F')); writeln(pred(TRUE)); writeln(succ(10)); writeln(succ('F')); writeln(succ(FALSE)); writeln('------------------------'); writeln(ord('A')); writeln(chr(65)); writeln(chr(7)); writeln('premi return'); readln; end.
program funzioni1; { funzioni standard ,senza SANE}
begin writeln(abs(-6)); writeln(sqr(5)); writeln(sqrt(100)); writeln(exp(3)); writeln(ln(100)); writeln(round(123.56)); writeln(trunc(123.654)); writeln(int(123.76)); writeln('-----------------------'); writeln(sin(30*3.14/180)); writeln(cos(2)); writeln(arctan(2)); writeln('-----------------------'); writeln(sin(2)/cos(2)); writeln(cos(2)/sin(2)); writeln(1.0/cos(2)); writeln(1.0/sin(2)); writeln('----------------------'); writeln(HI(256)); writeln(LO(256)); writeln(swap(17341)); writeln('----------------------'); writeln(pred(10)); writeln(pred('F')); writeln(pred(TRUE)); writeln(succ(10)); writeln(succ('F')); writeln(succ(FALSE)); writeln('------------------------'); writeln(ord('A')); writeln(chr(65)); writeln(chr(7)); writeln('premi return'); readln; end.
program funzioni2; { funzioni turbo 1.1 senza SANE }
var x:integer; frase:string;
begin writeln(100 mod 9); writeln(100 div 9); writeln(6*7); writeln(6+8); writeln(30-6); writeln(100/2); x:=-10; writeln(-x); writeln('----------------------'); writeln(length('parola')); frase:=concat('maria','rosa'); writeln(frase); frase:=copy('AAABBBCCC',4,3); writeln(frase); x:=pos('A','PADOVA'); writeln(x); writeln('---------------------------'); writeln('premi return'); readln; end.
program funzioni3; { funzioni standard senza sane }
var testo,radice,desinenza,media:string; lunghezza:integer;
begin testo:='manducare'; writeln(odd(5)); writeln(odd(6)); writeln('-------------------'); writeln(testo); lunghezza:=length(testo); writeln(length(testo)); writeln(lunghezza); writeln; radice:=copy(testo,1,lunghezza-3); writeln(radice); writeln; desinenza:=copy(testo,lunghezza-2,3); writeln(desinenza); writeln; media:=copy(testo,4,2); writeln(media); writeln; writeln('premi return'); readln; end.
program funzioni4; { funzioni attivate con USES sane cfr.instant pascal p.73 ss.}
uses sane;
var resto:integer; x:extended;
begin x:=1; writeln(remainder(100,9,resto)); writeln(rint(125.76)); writeln(scalb(2,25.65)); writeln(randomx(x)); writeln('premi return'); readln; end.