Code: Select all
*MemoryID The address of the memory area to resize. This value must be the result of a call to AllocateMemory() or ReAllocateMemory().
If this parameter is #Null, the command acts like AllocateMemory() and allocates a new memory area of the given size.
Code: Select all
*DataBuffer = #Null
For x = 1 To TotalSkillsCounted
y = x - 1
TextLength = Len(weaponskillsEx(y)\Language[LanguageCount])
*NewBuffer = ReAllocateMemory(*DataBuffer, MemorySize(*DataBuffer) + SizeOf(unicode) + TextLength)
If *NewBuffer
PokeU(*NewBuffer + WriteOffset,TextLength)
WriteOffset + #UnicodeLength
PokeS(*NewBuffer + WriteOffset, weaponskillsEx(y)\Language[LanguageCount], TextLength, #PB_Unicode | #PB_String_NoZero)
WriteOffset + TextLength
*DataBuffer = *NewBuffer
Else
FreeMemory(*Databuffer)
ProcedureReturn #AllocateMemoryError
EndIf
Next x
[ERROR] The specified '*MemoryID' is null.
Why is this not legal? *Datapointer is set to 0. (#NULL). Since its 0, it should just allocate memory, rather than reallocate