Hello very good work - i will check in the my holidays if can use some
functions on the PC Version - first check seems that there are many only useable for the AmigaOS4 System.
It would be great if you can continue your work and provide more functions useable on every system.
Also a good documentation would be perfect.
I put a small function from my development bib in this comment.
/**********
** Name: KeHo Software Function Bibliothek **
** Author: Achim Kern **
** Version: 1.0 **
** Date: 14.12.2012 **
** Interpreter: Hollywood **
** Licence: Freeware **
** Function: provide functions for software projects **
** History: **
** 1.0: (14.12.2012) **
** - initial release **
**********/
/* Hollywood Version required */
@VERSION 5,2
/* the KeHo Software bibliothek provides actual the following functions
Function p_GetPrivateProfilString(Group$,SearchString$,Default$,FileName$)
TASK read data strings out of a ini-file
example test$=p_GetPrivateProfilString("[REGISTRIERUNG]","USERSTREET","Rue Noir 12","usa.ini")
-Group$ name of the group in your ini-file - always in brackets
-SearchString$ data entry name
-Default$ if nothing is declared in your ini-file we take this string
-FileName$ the filename of your ini-file
*/
/-------------------------------------------------------------------------------/
/* FUNCTION p_GetPrivateProfilString(Group$,SearchString$,Default$,FileName$) /
/ /
/ TASK : read data strings in an ini-file /
/ UPDATE : 04.04.2011 /
/-------------------------------------------------------------------------------*/
Function p_GetPrivateProfilString(Group$,SearchString$,Default$,FileName$)
;test$=p_GetPrivateProfilString("[REGISTRIERUNG]","USERSTREET","Rue Noir 12","usa.ini")
Local FOUND=False
Local len0=StrLen(Group$)
Local len1=StrLen(SearchString$)
OpenFile(1,FileName$)
While Not Eof(1)
Local string$=ReadLine(1)
Local test$=LeftStr(string$,len0)
If test$=Group$
While Not Eof(1)
string$=ReadLine(1)
test$=LeftStr(string$,len1)
If (test$=SearchString$) And (FOUND=False)
string$=UnrightStr(string$,len1+1)
FoundString$=string$
FOUND=True
EndIf
Wend
EndIf
Wend
CloseFile(1)
If FOUND=True Then PrivateProfilString$=FoundString$ Else PrivateProfilString$=Default$
Return(PrivateProfilString$)
EndFunction |