home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
VarValue.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-06-04
|
2KB
|
70 lines
unit VarValue;
interface
uses LangValue;
type TVarValue=class(ILangValue)
protected
function rdAsInteger:integer;override;
procedure wrAsInteger(a:integer);override;
function rdAsBoolean:boolean;override;
procedure wrAsBoolean(a:boolean);override;
function rdAsFloat:Extended;override;
procedure wrAsFloat(a:Extended);override;
function rdAsString:string;override;
procedure wrAsString(a:string);override;
public
procedure Exec(S:IValStack;MustReturn:boolean);override;
property Value:variant read rdAsVariant write wrAsVariant;
end;
implementation
uses VarLangValue;
function TVarValue.rdAsInteger;
begin
Result:=Value;
end;
procedure TVarValue.wrAsInteger;
begin
Value:=a;
end;
function TVarValue.rdAsBoolean;
begin
Result:=Value;
end;
procedure TVarValue.wrAsBoolean;
begin
Value:=a;
end;
function TVarValue.rdAsFloat;
begin
Result:=Value;
end;
procedure TVarValue.wrAsFloat;
begin
Value:=a;
end;
function TVarValue.rdAsString;
begin
Result:=Value;
end;
procedure TVarValue.wrAsString;
begin
Value:=a;
end;
procedure TVarValue.Exec;
Var V:TVarLangValue;
begin
if S.FrameCount>0 then
begin
AsVariant:=S.FrameValues[0].AsVariant;
end;
S.DropFrame;
if MustReturn then
begin
v:=TVarLangValue.Create(nil);
v.AsVariant:=AsVariant;
S.Push(v);
end;
end;
end.