Recent

Author Topic: TINIFile Sig SegV  (Read 6816 times)

captian jaster

  • Guest
TINIFile Sig SegV
« on: August 17, 2010, 03:42:31 pm »
I have a problem.
This is my first time working with INI files and im learning by reading the fcl.
So I have this problem:
It raises and External Sig Seg V Error when i attempted to load it.
Code: [Select]
FontSet.Create(FontINI);//Font INI is a constant

The file does exist on my disk and i dont know what wrong  :\.
Data on the INI File:
[Font]
size=10
style=regular
style=nil

               

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TINIFile Sig SegV
« Reply #1 on: August 17, 2010, 05:05:19 pm »
Click here  for inifiles 101.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2591
Re: TINIFile Sig SegV
« Reply #2 on: August 18, 2010, 12:06:38 am »
use:
 FontSet := TIniFile.Create(FontINI);

this way you create an instance of a class.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

alejol0

  • Jr. Member
  • **
  • Posts: 60
  • Electronic technician
    • My Facebook page
Re: TINIFile Sig SegV
« Reply #3 on: August 19, 2010, 10:22:58 pm »
I have encountered that Lazarus needs  one or two blank lines
or lines commented in the first of the file.
I have trouble reading first INI key values if the .INI file do not have these two "dummy" lines.
Contact me: lavarello1966 (at) gmail . com
or
alejandro.lavarello (at) gmail (dot) com

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TINIFile Sig SegV
« Reply #4 on: August 19, 2010, 11:38:51 pm »
I have encountered that Lazarus needs  one or two blank lines
or lines commented in the first of the file.
I have trouble reading first INI key values if the .INI file do not have these two "dummy" lines.
I've never had this problem with Lazarus on Win/XP.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

Laksen

  • Hero Member
  • *****
  • Posts: 758
    • J-Software
Re: TINIFile Sig SegV
« Reply #5 on: August 19, 2010, 11:48:09 pm »
I have encountered that Lazarus needs  one or two blank lines
or lines commented in the first of the file.
I have trouble reading first INI key values if the .INI file do not have these two "dummy" lines.
Could be that you have a BOM byte in the file. The FCL inifile implementation doesn't handle that, as far as I can see

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TINIFile Sig SegV
« Reply #6 on: August 20, 2010, 12:09:34 am »
Could be that you have a BOM byte in the file.
One of the worst 'inventions' ever and almost undetectable because if present, even editors like notepad will not give you any warning about it's presence.

If you only use TInifile methods to create and populate the file, there shouldn't be any problem.
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

 

TinyPortal © 2005-2018