Cannot find function
BlitzMax Forums/BlitzMax Programming/Cannot find function
| ||
I know I am doing something stupid here but... in the following scenario I get the an "Compile Error: Identifier 'DifferenceIsLess' not found" error from within the camera.bmx file. main.bmx Strict Include "src/functions.bmx" Include "src/camera.bmx" src/functions.bmx Function DifferenceIsLess(A:Float,B:Float,DifCheck:Float) EndFunction src/camera.bmx Type Camera Function Update() If DifferenceIsLess(10,20,5) ' DO STUFF EndIf EndFunction EndType What am I doing wrong? Last edited 2012 |
| ||
You have a colon in your function definition which should be a comma ( after B:Float). |
| ||
Oops, typo above fixed, the actual code doesn't have this mistake. |
| ||
Also for what it's worth, I've got the clamp function in functions.bmx too, and I get the same error when that's calledFunction Clamp:Float(val:Float, minimum:Float = 0.0, maximum:Float = 1.0) Return Min (Max (val,minimum),maximum) EndFunction |
| ||
Ah, didn't think that'd even compile error-free! From experience, and i'm guessing theres a lot more code you haven't posted, i'd be looking for mismatched code blocks (if/endif etc) as that will often throw up an error elsewhere which is nothing to do with the actual problem. |
| ||
Damnit yeah there was other code, I had an Import elsewhere, instead of an Include :B Thanks anyway GfK. Very glad to see I've pretty much forgotten all of the BlitzMax stuff I once knew. |
| ||
Hahaha oh dear... and I didn't realise (forgot?) that blIDE automatically includes files added to the project... I'm on a roll |