Advertisement
sglienke

Untitled

Sep 22nd, 2016
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program Project1;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6.   StrUtils;
  7.  
  8. type
  9.   TMyOSPlatform = (Windows, OSX, iOS, Android);
  10.  
  11.   TProperties = (Width, Height, MarginLeft);
  12.  
  13. const
  14.   PropValues: array[TMyOSPlatform, TProperties] of Double = (
  15.     (121, 22, 40), (128, 24, 40), (138, 24, 40), (140, 28, 40)
  16.   );
  17.  
  18.   PropNames: array[TProperties] of string = ('Width', 'Height', 'MarginLeft');
  19.  
  20. const
  21.   IDAktPlatform = TMyOSPlatform.Windows;
  22.  
  23. function ByPlatform(const Prop: string): Single;
  24. begin
  25.   Result := PropValues[IDAktPlatform, TProperties(IndexText(Prop, PropNames))];
  26. end;
  27.  
  28. begin
  29. end.
Advertisement
RAW Paste Data Copied
Advertisement