Code: Alles auswählen
DataSection
MapLabel:
IncludeBinary "Data\map.data"
EndDataSection
Code: Alles auswählen
DataSection
MapLabel:
IncludeBinary "Data\map.data"
EndDataSection
Code: Alles auswählen
Procedure SaveIncludeData(FileName.s, StartOfData, EndOfData)
Protected r1, file, LenOfData
file = CreateFile(#PB_Any, FileName)
If file
LenOfData = EndOfData - StartOfData
r1 = WriteData(file, StartOfData, LenOfData)
CloseFile(file)
EndIf
ProcedureReturn r1
EndProcedure
DataSection
MapDataStart:
IncludeBinary "Data\map.data"
MapDataEnd:
EndDataSection
Debug SaveIncludeData("MapData.Dat", ?MapDataStart, ?MapDataEnd)
Code: Alles auswählen
EnableExplicit
Procedure StoreFile(path.s, *dataBegin, *dataEnd)
Protected hFile.i = OpenFile(#PB_Any, path)
If Not hFile
ProcedureReturn #False
EndIf
WriteData(hFile, *dataBegin, *dataEnd - *dataBegin)
CloseFile(hFile)
ProcedureReturn #True
EndProcedure
Define path.s = GetHomeDirectory() + "map.data"
If StoreFile(path, ?MapLabel, ?MapLabelEnd)
Debug "Map wurde erfolgreich in " + path + " gespeichert."
Else
Debug "Konnte Map nicht speichern. Ist " + path + " schreibgeschützt?"
EndIf
DataSection
MapLabel:
IncludeBinary "Data\map.data"
MapLabelEnd:
EndDataSection