Greetings,
Yes I made a mistake but I got bitten hard by this in production yesterday.
Create an empty project
In the form load:
dim someObject as object
set someObject = createobject("any.valid.object")
Create an empty function someFunction in form that accepts no arguments
In the form load
someFunction someObject
compile & run
Boom
Access violation.
Why does it even compile?
EDIT
If you make someFunction have a return value like "as boolean" then it no longer compiles
EDIT EDIT
if define someFuncion as a sub instead of a function it also does not compile.
Yes I made a mistake but I got bitten hard by this in production yesterday.
Create an empty project
In the form load:
dim someObject as object
set someObject = createobject("any.valid.object")
Create an empty function someFunction in form that accepts no arguments
In the form load
someFunction someObject
compile & run
Boom
Access violation.
Why does it even compile?
EDIT
If you make someFunction have a return value like "as boolean" then it no longer compiles
EDIT EDIT
if define someFuncion as a sub instead of a function it also does not compile.