; sizeof.dest must be defined!
macro GPPS dest,item {
match x=:y,item \{
invoke GetPrivateProfileString,INI.\#x,INI.\#y,x\#.\#y,dest,sizeof.\#dest,INI.file
\}
}
macro WPPS item,dest {
match x=:y,item \{
invoke WritePrivateProfileString,INI.\#x,INI.\#y,dest,INI.file
\}
}
...these are from a recent project. First layout the INI string you need:
; section and key names
INI:
.LOCALIZATION TCHAR 'LOCALIZATION',0
.TITLE TCHAR 'TITLE',0
.PROMPT0 TCHAR 'PROMPT0',0
.PROMPT1 TCHAR 'PROMPT1',0
.PATHS TCHAR 'PATHS',0
.GAME TCHAR 'GAME',0
.LIBRARY TCHAR 'LIBRARY',0
; section.key defaults
LOCALIZATION:
.TITLE TCHAR 'Custom Scenery:',0
.PROMPT0 TCHAR 'Select Custom Scenery Library Folder:',0
.PROMPT1 TCHAR 'Select Themed Folder:',0
PATHS:
.GAME TCHAR 'C:\Program Files\',0
...and then just:
GPPS gPath,PATHS:GAME
WPPS PATHS:GAME,gPath
Need to have a sizeof.gPath defined. Yes, I'm am this lazy - add more to it later. Maybe to build the string table automatically or something.