Author Topic: Add comment to ini file  (Read 2396 times)

bachphi

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
Add comment to ini file
« on: March 15, 2020, 01:42:25 PM »
How do I add comment to the ini file ?

I tried a variety without success.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

MajorFault

  • Guest
Re: Add comment to ini file
« Reply #1 on: March 15, 2020, 04:43:11 PM »

bachphi

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
Re: Add comment to ini file
« Reply #2 on: March 15, 2020, 05:15:46 PM »
It's not what you think!  The built-in ini-parser may not include the comment.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
    • View Profile
    • AdvancedHMI
Re: Add comment to ini file
« Reply #3 on: March 15, 2020, 07:06:16 PM »
- In Solution Explorer expand down the AdvancedHMIDrivers project
- Expand down the Common folder
- Right click IniParser.vb and select View Code
- Go to about line 50 and modify it to this:
Code: [Select]
                    If Not String.IsNullOrEmpty(strLine) And strLine.Trim.IndexOf(";") <> 0 Then
 

You should now be able to add line comments by starring with a semi-colon

bachphi

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
Re: Add comment to ini file
« Reply #4 on: March 16, 2020, 07:41:01 AM »
Thank You, Archie.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

bachphi

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
Re: Add comment to ini file
« Reply #5 on: May 24, 2020, 03:18:59 PM »
- In Solution Explorer expand down the AdvancedHMIDrivers project
- Expand down the Common folder
- Right click IniParser.vb and select View Code
- Go to about line 50 and modify it to this:
Code: [Select]
                    If Not String.IsNullOrEmpty(strLine) And strLine.Trim.IndexOf(";") <> 0 Then
 

You should now be able to add line comments by starring with a semi-colon

Can this be added to latest versions?
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
    • View Profile
    • AdvancedHMI
Re: Add comment to ini file
« Reply #6 on: May 24, 2020, 03:48:01 PM »
It was supposed to make it into the latest beta version, but got overlooked. It will show up in Beta 37

bachphi

  • Hero Member
  • *****
  • Posts: 667
    • View Profile
Re: Add comment to ini file
« Reply #7 on: May 25, 2020, 02:20:33 PM »
It was supposed to make it into the latest beta version, but got overlooked. It will show up in Beta 37

Thanks, Archie. A value-added feature.

Code: [Select]
; PLC driver: [Section], Keyname
; Example:
; [PLC]
;IPAddress=192.168.0.10
;PollRateOverride=0

;[PLC_Slow]
;IPAddress=192.168.0.10
;PollRateOverride=500

;file parsing
; Dim parser As New AdvancedHMIDrivers.IniParser(".\INI_TXT\Settings.ini")
;                Dim myInt As Integer = CInt(parser.GetSetting("Section", "Keyname"))

===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================