Raised This Month: $ Target: $400
 0% 

Invalid function or declaration


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 12-12-2005 , 13:37  
Reply With Quote #7

Well, in small, you can only have these things on global scope:
  • - comments
    - preprocessor stuff
    - global variable definitions
    - function declarations and definitions

Real statements like assigments are not allowed there (the only entry points in small programs are public functions; the host applications decides when to call those; so from a logical point of view, when would code placed outside any function be executed?) .

If you want to simply initialize the global variable to the specified values, do:
Code:
new Float:colors[TOTALCOLORS][3] = { {123.0, 123.0, 123.0}, {456.0, 456.0, 456.0}, {789.0, 789.0, 789.0} }

Maybe you'd like to declare the variable const as well if small supports it.

edit: freaking typos!

Brad: I'm CHUCK NORRIS and I HAVE A BEARD
__________________
hello, i am pm
PM is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode