1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| Program project1;
{$mode objfpc}{$H+}
{$apptype console}
Uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
Cthreads,
{$ENDIF}{$ENDIF}
Classes, sysUtils, Process, crt
{ you can add units after this };
var
login : string;
AProcess: TProcess;
codsql:string;
Begin
clrscr;
textbackground(red);
textcolor(white);
writeln('Enter You''re name :');
textbackground(black);
textcolor(white);
gotoxy(20,1);
readln(login);
textbackground(blue);
textcolor(yellow);
writeln;
writeln('Welcome ' + Login);
Writeln;
textbackground(Green);
textcolor(LightCyan);
textbackground(Black);
textcolor(White);
Writeln('Tapez "entrée" pour continuer....');
ReadLn;
writeln('Affichage du contenu d''une table');
sleep (2000);
// clrscr;
codsql:='SELECT UPPER(Lastname) AS ''Nom'' , FirstName AS ''Prénom'' , SUBSTR(BirthDate,1,10) AS ''Date Nais'' FROM employees';
codsql:=codsql+' ORDER BY BirthDate';
AProcess := TProcess.Create(nil);
AProcess.Executable := 'sqlite3' ;
AProcess.Parameters.Add('chinook.db');
AProcess.Parameters.Add('.headers on');
AProcess.Parameters.Add('.mode column');
AProcess.Parameters.Add('.width 5 5 40');
AProcess.Parameters.Add(codsql);
AProcess.Options := AProcess.Options + [poWaitOnExit];
AProcess.Execute;
AProcess.Free;
Writeln;
writeln('ça ne marche pas bien avec crt...');
readln;
End. |
Partager