home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
SAMPLE
/
LangQueryU.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-06-23
|
4KB
|
144 lines
unit LangQueryU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
LangValue, VisualValue, ClassValue, ValueUtils, LangProc,DB,DBTables;
type
TLangQuery = class(TDataModule)
QueryClass: TClassValue;
CreateProc: TLangProc;
DatabaseName: TLangProc;
SQL: TLangProc;
OpenProc: TLangProc;
CloseProc: TLangProc;
FirstProc: TLangProc;
NextProc: TLangProc;
EOFP: TLangProc;
GetValueP: TLangProc;
procedure CreateProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
procedure DatabaseNameExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
procedure SQLExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
procedure OpenProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
procedure CloseProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
procedure FirstProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
procedure NextProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
procedure EOFPExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
procedure GetValuePExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
LangQuery: TLangQuery;
implementation
uses uRunTime;
{$R *.DFM}
procedure TLangQuery.CreateProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
begin
SetObjectOf(Sender,TQuery.Create(nil));
// MessageDlg(S.FrameValues[0].AsSTring,mtInformation,[mbOk],0);
S.DropFrame;
ReturnTrue(S,MustReturn);
end;
procedure TLangQuery.DatabaseNameExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
begin
if S.FrameCount>0 then
begin
(GetObjectOf(Sender) as TQuery).DatabaseName:=S.FrameValues[0].AsString;
end;
S.DropFrame;
ReturnString(S,MustReturn,(GetObjectOf(Sender) as TQuery).DatabaseName);
end;
procedure TLangQuery.SQLExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
begin
if S.FrameCount>0 then
begin
(GetObjectOf(Sender) as TQuery).SQL.Text:=S.FrameValues[0].AsString;
end;
S.DropFrame;
ReturnString(S,MustReturn,(GetObjectOf(Sender) as TQuery).SQL.Text);
end;
procedure TLangQuery.OpenProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
begin
S.DropFrame;
(GetObjectOf(Sender) as TQuery).Open;
ReturnTrue(S,MustReturn);
end;
procedure TLangQuery.CloseProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
begin
S.DropFrame;
(GetObjectOf(Sender) as TQuery).Open;
ReturnTrue(S,MustReturn);
end;
procedure TLangQuery.FirstProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
begin
S.DropFrame;
(GetObjectOf(Sender) as TQuery).First;
ReturnTrue(S,MustReturn);
end;
procedure TLangQuery.NextProcExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
begin
S.DropFrame;
(GetObjectOf(Sender) as TQuery).Next;
ReturnTrue(S,MustReturn);
end;
procedure TLangQuery.EOFPExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
begin
S.DropFrame;
ReturnBool(S,MustReturn,(GetObjectOf(Sender) as TQuery).EOF);
end;
procedure TLangQuery.GetValuePExec(Sender: TVisualValue; S: IValStack;
MustReturn: Boolean);
Var v:Variant;
begin
if S.FrameCount>0 then
begin
v:=(GetObjectOf(Sender) as TQuery)
.FieldByName(S.FrameValues[0].AsString).
AsVariant;
s.DropFrame;
ReturnVar(S,MustReturn,v);
end
else
begin
s.DropFrame;
ReturnTrue(S,MustReturn);
end;
end;
end.