Return Name ?
BlitzMax Forums/BlitzMax Beginners Area/Return Name ? Yeah, you probably have to do a=bitmap(n), and of course if a isn't defined you may need Local a:whatever= or Global etc. Otherwise, with bitmap(a) you would be passing the value stored in variable a (which if undefined will be 0), to the function, and are reading back from the function nothing because you don't make the function equal anything. To store the return value you have to do something=function(n).
You could also optionally use VarPtr to pass the pointer to the variable `a` so that you can directly modify it in the function. ie.
or something like that, although Mikkel's version is easier to do.
You could also optionally use VarPtr to pass the pointer to the variable `a` so that you can directly modify it in the function. ie.
Function bitmap(nameptr:Int Ptr) nameptr[0]=createbitmap() End Function Local a:Int=0 bitmap(VarPtr(a)) hidebitmap(VarPtr(a))
or something like that, although Mikkel's version is easier to do.
This really helps me out Thank you guys