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 >
Pascal/Delphi Source File  |  1998-06-04  |  2KB  |  70 lines

  1. unit VarValue;
  2.  
  3. interface
  4. uses LangValue;
  5. type TVarValue=class(ILangValue)
  6.      protected
  7.         function rdAsInteger:integer;override;
  8.         procedure wrAsInteger(a:integer);override;
  9.         function rdAsBoolean:boolean;override;
  10.         procedure wrAsBoolean(a:boolean);override;
  11.         function rdAsFloat:Extended;override;
  12.         procedure wrAsFloat(a:Extended);override;
  13.         function rdAsString:string;override;
  14.         procedure wrAsString(a:string);override;
  15.      public
  16.         procedure Exec(S:IValStack;MustReturn:boolean);override;
  17.         property Value:variant read rdAsVariant write wrAsVariant;
  18.      end;
  19. implementation
  20. uses VarLangValue;
  21. function  TVarValue.rdAsInteger;
  22.           begin
  23.             Result:=Value;
  24.           end;
  25. procedure TVarValue.wrAsInteger;
  26.           begin
  27.             Value:=a;
  28.           end;
  29. function  TVarValue.rdAsBoolean;
  30.           begin
  31.             Result:=Value;
  32.           end;
  33. procedure TVarValue.wrAsBoolean;
  34.           begin
  35.             Value:=a;
  36.           end;
  37. function  TVarValue.rdAsFloat;
  38.           begin
  39.             Result:=Value;
  40.           end;
  41. procedure TVarValue.wrAsFloat;
  42.           begin
  43.             Value:=a;
  44.           end;
  45. function  TVarValue.rdAsString;
  46.           begin
  47.             Result:=Value;
  48.           end;
  49. procedure TVarValue.wrAsString;
  50.           begin
  51.             Value:=a;
  52.           end;
  53. procedure TVarValue.Exec;
  54.           Var V:TVarLangValue;
  55.           begin
  56.             if S.FrameCount>0 then
  57.             begin
  58.               AsVariant:=S.FrameValues[0].AsVariant;
  59.             end;
  60.             S.DropFrame;
  61.             if MustReturn then
  62.             begin
  63.               v:=TVarLangValue.Create(nil);
  64.               v.AsVariant:=AsVariant;
  65.               S.Push(v);
  66.             end;
  67.           end;
  68.  
  69. end.
  70.