1 { 2 Rutinas y variables globales a la aplicación 3 } 4 unit Globales; 5 6 {$mode objfpc}{$H+} 7 8 interface 9 uses Classes, SysUtils, Forms, Graphics, Dialogs, SynEdit, SynEditKeyCmds, 10 SynEditTypes, StrUtils, lclType, syncompletion, Process, FileUtil, 11 ShellApi; 12 13 const 14 NOM_PROG = 'PreSQL 2.2b'; //nombre de programa 15 16 procedure MsgExc(msje: string); 17 procedure MsgErr(msje: string); 18 procedure MsgBox(txt: PChar); 19 procedure MsgBox(txt: String); 20 21 procedure Shell(cmd:string); 22 23 implementation 24 25 procedure MsgExc(msje: string); 26 //Mensaje de exclamación 27 begin 28 Application.MessageBox(PChar(msje), '', MB_ICONEXCLAMATION); 29 end; 30 procedure MsgErr(msje: string); 31 //Mensaje de error 32 begin 33 Application.MessageBox(PChar(msje), '', MB_ICONERROR); 34 end; 35 36 procedure MsgBox(txt: PChar); 37 begin 38 Application.MessageBox(txt,'Caption',0); 39 end; 40 41 procedure MsgBox(txt: String); 42 begin 43 Application.MessageBox(Pchar(txt),'Caption',0); 44 end; 45 46 procedure Shell(cmd: string); 47 //Ejecuta un programa externo 48 var 49 p: TProcess; 50 begin 51 //compila 52 p := TProcess.Create(nil); 53 p.CommandLine := cmd; 54 p.Options := p.Options + [poWaitOnExit]; 55 p.Execute; 56 p.Free; 57 end; 58 59 end. 60 61