I was trying out functions for the first time today, trying to
make a function to automate object and image numbering and also
a function to calculate the distance between two objects.
However, whenever I compile + try to run, I get:
"Early exit error. You have hit a function declaration mid-program."
What does this error mean? I see nothing wrong with my functions (in terms of producing an error). The error occurs at the first function declaration.
global ict
global oct
Function icount(ict) `image counter
ict = ict + 1
Endfunction ict
Function ocount(oct) `object counter
oct = oct + 1
Endfunction oct
Function dis#(object1x#, object1z#, object2x#, object2z#) ` measures distance between two objects
distance# = (object1x# - object2x#)^2 + (object1z# - object2z#)^2
distance# = SQRT(distance#)
Endfunction distance#