I don't think it's Rob, but it might be me
Just put this in a separate .dba file and use the IDE to include it
#constant KERNEL32DLLNUMBER 203
function InitialiseKernel32DLL()
load dll "kernel32.dll", KERNEL32DLLNUMBER
endfunction
function ShutdownKernel32DLL()
delete dll KERNEL32DLLNUMBER
endfunction
function GetPrivateProfileInt(Section as string, KeyName as string, Default as integer, FileName as string)
r as integer
r=val(GetPrivateProfileString(Section, KeyName, str$(Default), FileName))
endfunction r
function WritePrivateProfileInt(Section as string, KeyName as string, Value as integer, FileName as string)
WritePrivateProfileString(Section, KeyName, str$(Value), FileName)
endfunction
function GetPrivateProfileString(Section as string, KeyName as string, Default as string, FileName as string)
r as string
r=space$(1024)
call dll KERNEL32DLLNUMBER, "GetPrivateProfileStringA", Section, KeyName, Default, r, len(r), FileName
endfunction r
function WritePrivateProfileString(Section as string, KeyName as string, Value as string, FileName as string)
call dll KERNEL32DLLNUMBER, "WritePrivateProfileStringA", Section, KeyName, Value, FileName
endfunction r
You use it like this
InitialiseKernel32DLL()
WritePrivateProfileString("section", "key", "default", "filename.ini")
print GetPrivateProfileString("section", "key", "just get it", "filename.ini")
ShutdownKernel32DLL()
Run this code and look at the filename.ini to see the format it uses.