How to write/read INI-files on the "sunny" way?

Linux specific forum
lnxque
User
User
Posts: 30
Joined: Tue Jan 26, 2010 4:06 pm

How to write/read INI-files on the "sunny" way?

Post by lnxque »

Is there an easy solution for this Windows-code available under Linux?

Code: Select all

Procedure.s INI_Lesen(Bereich.s, Eintrag.s, Datei.s)
  Protected rueck.l, tmp.s
  tmp = Space(255)
  rueck = GetPrivateProfileString_(Bereich, Eintrag, tmp, @tmp, 255, Datei)
  ProcedureReturn Left(tmp, rueck)
EndProcedure

Procedure INI_Schreiben(Bereich.s, Eintrag.s, Wert.s, Datei.s)
  Protected rueck.l
  If Trim(Eintrag) = ""
     ;Bereich entfernen 
     rueck = WritePrivateProfileString_(Bereich, 0, 0, Datei)
  ElseIf Trim(Wert) = "" 
     ;Eintrag entfernen
     rueck = WritePrivateProfileString_(Bereich, Eintrag, 0, Datei)
  Else
     ;Eintrag schreiben/ändern
     rueck = WritePrivateProfileString_(Bereich, Eintrag, Wert, Datei)
  EndIf
EndProcedure

Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: How to write/read INI-files on the "sunny" way?

Post by Fred »

Preferences library ?
lnxque
User
User
Posts: 30
Joined: Tue Jan 26, 2010 4:06 pm

Re: How to write/read INI-files on the "sunny" way?

Post by lnxque »

Solved (in parts). Wrote (reading)/will write (writing) the functionality in PB.
Post Reply