In my latest project, I made a function that takes a color value (from the POINT command), and returns a string representing the color name. This caused my program to crash via the "DBP process has performed an illegal operation" window.
It turns out the problem is to do with assigning the returned string to a variable. I have replicated it, to an extent, in this code:
sync on: sync rate 0
colorName$ = ReturnString()
`ReturnString()
colorNumber = ReturnNumber()
do
text 1,1,colorName$
text 1,10,str$(colorNumber)
sync
loop
function ReturnString()
endfunction "NONE"
function ReturnNumber()
endfunction 0
On my machine, it runs OK (unlike my game), but crashes when you hit ESCAPE to quit. I think it's a different symptom of the same problem.
If you uncomment the ReturnString() line, which doesn't have the assignment part of it, and comment out the one above, it doesn't crash on exit.
-Newest DBP Upgrade
-Windows 7 64Bit (Could be something to do with this perhaps?)
I'm sure I've returned strings from functions before without an issue on previous upgrades and Windows XP, but it's failing now on the latest with Win7 64bit.
Radical hamsters skipping furiously into the blue ether, questioning their very existence while breathing out the bitter fog of smoked haddock.