home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / Chip_2000-02_cd.bin / zkuste / Delphi / navody / tt / objvm.exe / UNITS / LangVariables.pas < prev    next >
Pascal/Delphi Source File  |  1998-03-13  |  1KB  |  43 lines

  1. unit LangVariables;
  2.  
  3. interface
  4. uses LangValue,
  5.      NamedValuesList,LangVariable,ProxyValue;
  6. type TLangVariables=class(ILangValue)
  7.      protected
  8.         Variables:TNamedValuesList;
  9.         function  rdValues(const s:string):ILangValue;override;
  10.      public
  11.         constructor Create;
  12.         destructor  Destroy;override;
  13.         function  HasValue(const s:string):boolean;override;
  14.      end;
  15. implementation
  16. function    TLangVariables.rdValues;
  17.             Var a:TProxyValue;
  18.             begin
  19.               Result:=Variables.ValByName(s);
  20.               if Result=nil then
  21.               begin
  22.                 Result:=TLangVariable.Create;
  23.                 Variables.Add(S,Result);
  24.               end;
  25.               Result:=TProxyValue.CreateFrom(Result);
  26.             end;
  27. constructor TLangVariables.Create;
  28.             begin
  29.               inherited Create(nil);
  30.               Variables:=TNamedValuesList.Create;
  31.             end;
  32. destructor  TLangVariables.Destroy;
  33.             begin
  34.               Variables.Free;
  35.               inherited Destroy;
  36.             end;
  37. function    TLangVariables.HasValue;
  38.             begin
  39.               Result:=True;
  40.             end;
  41.  
  42. end.
  43.