home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
InputQueryProc.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-03-13
|
2KB
|
70 lines
unit InputQueryProc;
interface
uses LangValue,
VarLangValue,Dialogs;
type TInputQueryProc=class(ILangValue)
procedure Exec(S:IValStack;MustReturn:boolean);override;
end;
implementation
procedure TInputQueryProc.Exec;
Var sCaption,sPrompt,sValue:string;
aResult:boolean;
iCaption,iPrompt,iValue:integer;
vCaption,vPrompt,vValueRef,vValue,vResult:ILangValue;
begin
sCaption:='';
sPrompt:='';
sValue:='';
vValueRef:=nil;
iCaption:=-1;
iPrompt:=-1;
iValue:=-1;
case s.FrameCount of
1:begin
iValue:=0;
end;
2:begin
iPrompt:=0;
iValue:=1;
end;
3:begin
iCaption:=0;
iPrompt:=1;
iValue:=2;
end;
end;
if iValue<>-1 then
begin
vValueRef:=s.FrameValues[iValue].CreateEqu;
vValue:=vValueRef.GetValue;
sValue:=vValue.AsString;
vValue.Free;
end;
if iPrompt<>-1 then
begin
sPrompt:=s.FrameValues[iPrompt].AsString;
end;
if iCaption<>-1 then
begin
sCaption:=s.FrameValues[iCaption].AsString;
end;
s.DropFrame;
aResult:=InputQuery(sCaption,sPrompt,sValue);
if iValue<>-1 then
begin
vValue:=TVarLangValue.Create(nil);
vValue.AsString:=sValue;
vValueRef.SetValue(vValue);
vValueRef.Free;
end;
if MustReturn then
begin
vResult:=TVarLangValue.Create(nil);
vResult.AsBoolean:=aResult;
s.Push(vResult);
end;
end;
end.