well, don't know quite what you mean about your original inquiry, but I can probably help with functions. They are VERY important aspects of a language so are good to know and know well.
Functions have very easy syntax. Here's an example of a very basic function:
Function myFunction()
Rem You would insert code here
EndFunction
What that does is gives you a basic function template. When you type:
All the code where "Rem You would insert code here" is would get called (as you would have guessed probably). Parameters are what give power to a function. Say you want to pass in an integer value, you would type in this when making your function (using the same function as above for this example).
Function myFunction(myParam as Integer)
Rem Now lets say we want to add 2 to it
myParam = myParam + 2
EndFunction
I said parameters give a function power, but being able to return information is what truely makes a function a function. That can be done in one of two ways. For the sake of space I'll show both in the same function.
Function MyFunction(myParam as Integer)
myResult as Integer
myResult = myParam + 2
ExitFunction myResult
EndFunction myResult
The first way you return data in this case is with the "ExitFunction" command. This command doesn't have to have a parameter so you could just call "ExitFunction", but with a parameter, that value gets passed. For instance, if I called this function like so:
x would now be 6 because you passed in a 4 (myParam) and the result (which will be myResult) equals myParameter + 2.
The other way to return a value is basically by slapping it on the end of your 'EndFunction' the same way you would with 'ExitFunction'. 'ExitFunction' and 'EndFunction' do not require parameters (read that return values), and you also are not required to use 'ExitFunction'. It is good for leaving a function early, for example:
Function MoveObject(myObject as Integer, Speed as Integer)
if myObject <= 0 then ExitFunction
Move Object myObject, Speed
EndFunction
This function is a safe function if you have no idea what value myObject is. In Dark Basic, passing a handle to an object less than 0 will result in a runtime error. This function would make sure that wouldn't happen by exiting early before I manipulated the object. Notice also that you can attatch more than one parameter by adding commas to sperate them.
Here's a shot at your main answer, though. See if you can figure out how it works:
Function GetInformation(Object1, Object2)
Message as string
if Object Collision(Object1, Object2) and inkey$() = "e"
ExitFunction Message
endif
EndFunction ""
I hope that helps, and if it feels like I was belittling your knowledge of DB, forgive me, I had no intent. I just have no idea how knowledgeable you are with DB so I brought it down the elemental levels as much as I could so I didn't miss anything important. Good luck with your project!