Identifier 'binpath' not found

Monkey Forums/Monkey Beginners/Identifier 'binpath' not found

GfK(Posted 2014) [#1]
I have a string var, called "binpath". I want to be able to access this from every class/method in my game.

How?

Apparently putting Global binpath:String="C:" is not the way, as I get "Identifier 'binpath' not found". So if that's not the way, what is?


MikeHart(Posted 2014) [#2]
Works fine here. if you wanna access it from a different file, make sure you import the file in it, where the global is defined.


slenkar(Posted 2014) [#3]
it should work if you import the monkey file that has the global in it


GfK(Posted 2014) [#4]
Thanks... that's the bit I was missing.


Why0Why(Posted 2014) [#5]
Dave, one thing I got in the habit of doing thanks to Mike's book is I make a file that has all the imports in it and then you only have to have one import in each of your files.


GfK(Posted 2014) [#6]
Thanks - handy tip.

Mike's book???? What's Mike's book?


dawlane(Posted 2014) [#7]
For Mike Hart's book check out the links in his signatures.


MikeHart(Posted 2014) [#8]
I don't think that my book will help him.


GfK(Posted 2014) [#9]
I don't think that my book will help him.

...marketing's not your strong point, is it?


MikeHart(Posted 2014) [#10]
I just care about my reader base. And judging by your posts on both boards, i simply don't think that the book will suit your needs. But maybe i misjudge you.

what do you expect from a book like this?


Raul(Posted 2014) [#11]
@MikeHart:
I think GfK wanted to say that you should try to sell your work. It doesnt matter if the buyer needs it or not. You should make him thinks he will need it :P