home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
ValueUtils.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-06-26
|
2KB
|
67 lines
{Useful procedures}
unit ValueUtils;
interface
uses
LangValue;
procedure ReturnTrue(s:IValStack;MustReturn:boolean);
procedure ReturnBool(s:IValStack;MustReturn:boolean;a:boolean);
procedure ReturnString(s:IValStack;MustReturn:boolean;const str:string);
procedure ReturnVar(s:IValStack;MustReturn:boolean;avar:Variant);
procedure SetObjectOf(val:ILangValue;a:TObject);
function GetObjectOf(val:ILangValue):TObject;
implementation
uses VarLangValue,ObjectValue,VisualValue;
procedure ReturnTrue(s:IValStack;MustReturn:boolean);
Var v:TVarLangValue;
begin
if MustReturn then
begin
v:=TVarLangValue.Create(nil);
v.AsBoolean:=True;
s.Push(v);
end;
end;
procedure ReturnBool(s:IValStack;MustReturn:boolean;a:boolean);
Var v:TVarLangValue;
begin
if MustReturn then
begin
v:=TVarLangValue.Create(nil);
v.AsBoolean:=a;
s.Push(v);
end;
end;
procedure ReturnString(s:IValStack;MustReturn:boolean;const str:string);
Var v:TVarLangValue;
begin
if MustReturn then
begin
v:=TVarLangValue.Create(nil);
v.AsString:=str;
s.Push(v);
end;
end;
procedure ReturnVar(s:IValStack;MustReturn:boolean;avar:variant);
Var v:TVarLangValue;
begin
if MustReturn then
begin
v:=TVarLangValue.Create(nil);
v.AsVariant:=avar;
s.Push(v);
end;
end;
procedure SetObjectOf;
begin
(((Val as TVisualValue).LangOwner) as TObjectValue ).Target:=a;
end;
function GetObjectOf;
begin
Result:=(((Val as TVisualValue).LangOwner) as TObjectValue).Target;
end;
end.