Code: Alles auswählen
Procedure.s GetString(File$,Group$,Command$)
If ReadFile(0,File$)
While Not Eof(0)
string$=ReadString(0)
For a=1 To Len(string$)
If Mid(string$,a,Len("Class "+Group$+"{"))="Class "+Group$+"{"
Repeat
string1$=ReadString(0)
For l=1 To Len(string1$)
If Mid(string1$,l,Len(Command$+"='"))=Command$+"='"
Repeat
b=b+1
Until Mid(string1$,l+Len(Command$+"='")+b,2)="';" or b>len(string1$)
Value$=Mid(string1$,l+Len(Command$+"='"),b)
EndIf
If Mid(string1$,l,2)="};"
breakn.s="};"
Break
EndIf
Next
Until breakn="};"
EndIf
Next
Wend
CloseFile(0)
EndIf
ProcedureReturn Value$
EndProcedure
Code: Alles auswählen
Class PureBasic{
currentversion='4.2';
};
Edit by DW: Danke!
Und das ist jetzt nicht nur für Preferences gut, man könnte so z.B auch "Klassen" für z.B dynamische meshes in seinem Spiel erstellen bzw. seinem Spiele eine gewisse Mod-Fähigkeit geben.