INI file in pb
Re: INI file in pb
have a look at preferencelib.
			
			
									
									Please correct my english
http://purebasic.developpez.com/
						http://purebasic.developpez.com/
Re: INI file in pb
Code: Select all
;
; ------------------------------------------------------------
;
;   PureBasic - Preference example file
;
;    (c) 2002 - Fantaisie Software
;
; ------------------------------------------------------------
;
If CreatePreferences("Preferences.prefs")
  PreferenceGroup("Global")
    WritePreferenceString("ApplicationName", "MP3 Player")
    WritePreferenceString("Version", "1.1b")
  PreferenceComment(" This is the Window dimension")
  PreferenceComment("")
  PreferenceGroup("Window")
    WritePreferenceLong ("WindowX", 123)
    WritePreferenceLong ("WindowY", 124)
    WritePreferenceFloat("WindowZ", -125.5)
  ClosePreferences()
EndIf
OpenPreferences("Preferences.prefs")
  PreferenceGroup("Window")
    Debug ReadPreferenceLong ("WindowX", 0)
    Debug ReadPreferenceLong ("WindowY", 0)
    Debug ReadPreferenceFloat("WindowZ", 0)
    
  PreferenceGroup("Global")
    Debug ReadPreferenceString("ApplicationName", "")
    Debug ReadPreferenceString("Version", "")
    
ClosePreferences()----
R Tape loading error, 0:1
						R Tape loading error, 0:1
Re: INI file in pb
em_uk
I was just taking a look at what I needed to do to create and use an "ini" file and stumbled across your response here to
another user question covering this very topic. Anyway, to cut a long story short, your posted code snippet just saved
me at least two or three hours which I would otherwise have wasted in figuring it out for myself.
Thanks a lot em_uk
			
			
									
									
						I was just taking a look at what I needed to do to create and use an "ini" file and stumbled across your response here to
another user question covering this very topic. Anyway, to cut a long story short, your posted code snippet just saved
me at least two or three hours which I would otherwise have wasted in figuring it out for myself.
Thanks a lot em_uk


