View Single Post
  #2  
Old 28-08-2017, 12:50
JRD!'s Avatar
JRD! JRD! is offline
Registered User
 
Join Date: Sep 2015
Location: Matrix
Posts: 274
Thanks: 225
Thanked 600 Times in 168 Posts
JRD! is on a distinguished road
function GetIniBool(const Section, Key: String; const: Boolean; const Filename: String): Boolean;
function GetIniInt(const Section, Key: String; const Default, Min, Max: Longint; const Filename: String): Longint;
function GetIniString(const Section, Key, Default, Filename: String): String;
Code:
Example:

var
  sCaption: string;
  iLeft, iTop, iWidth, iHeight: integer;
  bChecked: boolean;

  sCaption:=GetIniString('chkb', 'Caption', 'Component 1', ExpandConstant('{src}') + '\YourFile.ini');
  iLeft:=GetIniInt('chkb', 'Left', '30', ExpandConstant('{src}') + '\YourFile.ini');
  iTop:=GetIniInt('chkb', 'Top', '50', ExpandConstant('{src}') + '\YourFile.ini');  
  iWidth:=GetIniInt('chkb', 'Width', '150', ExpandConstant('{src}') + '\YourFile.ini');
  iHeight:=GetIniInt('chkb', 'Height', '20', ExpandConstant('{src}') + '\YourFile.ini'); 
  bChecked=GetIniBool('chkb', 'Checked', 'true', ExpandConstant('{src}') + '\YourFile.ini');

  CheckBox1.Caption:=sCaption;
  CheckBox1.SetBounds(iLeft, iTop, iWidth, iHeight);
  CheckBox1.Checked:=bChecked;
__________________
Practice makes perfect.
Reply With Quote
The Following 2 Users Say Thank You to JRD! For This Useful Post:
EzzEldin16 (28-08-2017), Simorq (28-08-2017)