Blitz Max Questions on Max forums
Blitz3D Forums/Blitz3D Programming/Blitz Max Questions on Max forums
| ||
Hi. I'm sure some of you will be aware how miffed I am at the crap way BR are handling the forums ATM. and I hate the BlitzMax Q&A sticky, Its a complete waste of time as no one really reads it. SO Anyone NOT YET GOT blitz max bubt wants to ask a Blitz Max question on the Blitz Maxc forums, post it HERE. Next time im on and see your reply I will then pop into the Max forums and Ask your question for you. Hope this helps the people out who were like me and just wanted to ask questions to the people using the software right now. ANSWERS - >> http://www.blitzbasic.com/Community/posts.php?topic=42227 |
| ||
Thanks for that! 1:) My question is; When a function is declared inside types, is that function Global? It looks some people use a function to instantiate more types. 2:) And by using functions this way, is it similar to constructors? |
| ||
1:) When do variables loose their scope? If I declare a variable inside an if...endif block, is scope lost when it exits? 2:) What about in methods and functions declared inside types? As I look over some examples, I assume when you delcare a variable using the Local keyword then it should be local to that block of code. 3:) And also when you're accessing members, member functions and etc; is there some type of intellisense that comes up? |
| ||
I think I can answer some of that. It is and it isnt global, you cant just call the function on its own from anywhere in your code, but you can if you do it through the type. mytype.runmyfunction() would work global runmyfunction() would not work. as I read it anyway i might be wrong. I think var's only lose scope when they leave the function they are declaired in but im not sure myself. so Ill pop that onto the max forums for ya.. You will be able to view the thread I create over there so I will add a link in this thread to the question in max forums so you can find it easy. and with luck get your answer. |
| ||
The following will run fine, so a function in a type declaration will work fine even if there are no instances of that type. Type TestType Method testf() Global d = Rand(1,10) Print d End Method Function globTest() Print "this is a test of global functions within types" End Function End Type TestType.globTest() myType:TestType = New TestType myType.testf() Print d end |
| ||
Thanks guys! |
| ||
Np. glad to help out. |