@Mr. Flibble
"Gosubs arn't functions, thuis the variable aren't global."
I never said gosubs were functions. My point was almost everything can access a variable if it is declared outside of a function. Besides if you want to access a variable through a function just pass it to it like this:
var$ = "hello"
BetterPrint(var$)
wait key
function BetterPrint(text)
print text
endfunction

Anyway, as to your other problem.
"To make it easier to use the interface in our game, i have simulated the RECT type that i in c/c++, then given it a value and forwarded it to a function like so:
TYPE RECT
x1 as integer
y1 as integer
x2 as integer
y2 as integer
ENDTYPE
`Tis global co i need it in another function
global iRect_dropped as RECT
iRect_dropped.x1 = 240
iRect_dropped.y1 = 527
iRect_dropped.x2 = 560
iRect_dropped.y2 = 600
if MouseOverRect(iRect_dropped) and mouseclick() = 1
Do stuff
Endif
Function MouseOverRect(AreaRect as RECT)
Over as Integer
Over=0
if mousex()>=AreaRect.x1 and mousey()>=AreaRect.y1 and mousex()<=AreaRect.x2 and mousey()<=AreaRect.y2 then Over=1
EndFunction Over
I'm not too sure what your problem is exactly as I would need to see more code, but I have found one error that stood out:
Function MouseOverRect(AreaRect as RECT)
Over as Integer
Over=0
if mousex()>=AreaRect.x1 and mousey()>=AreaRect.y1 and mousex()<=AreaRect.x2 and mousey()<=AreaRect.y2 then Over=1
EndFunction Over
If your are trying to return your variable Over your going to have to set your function up like this:
Over = Function MouseOverRect(AreaRect as RECT)
Over as Integer
Over=0
if mousex()>=AreaRect.x1 and mousey()>=AreaRect.y1 and mousex()<=AreaRect.x2 and mousey()<=AreaRect.y2 then Over=1
EndFunction Over
You can't return a variable from a function unless you set the function call to a variable. I know this isn't documented in the help files but a lot isn't documented in the help files and I thought I would give you a leg up here and point this out because I've run into this problem before myself. And as a side note, may I recommend the DBPro Online Glossary. It is better than the help manaul sometimes and helped me solve that function problem. You can find it here at :
http://www.realgametools.net/glossary/index.php3?theme=1&level=2&document_id_select=3
I hope this information will be of some use to you.