Mononoko 0 Report post Posted July 7, 2007 were doing a course in ICT called multimedia, but i dont know how to define variablesand whenever i ask my teacher he always goes "were not that far yet"he doesn't even look at what i have done, assumes I'm not finished, when i am, the only thing i need now is a scoring system Share this post Link to post Share on other sites
shadowx 0 Report post Posted July 7, 2007 What language are you using? i would assume its visual basic, AKA "VB", if so the usual way to do this is with code like this: Dim VariableName As TypeEG:Dim Score As IntegerAnd then to assign a value:Score = "1" That probably isnt completely right but it will give you an idea, i, sure the first part, "Dim.." is fine but as for the secnd im not so sure, i dont use VB much. If its anther language let us know and someone can help I remember doing multimedia at college... it was dreadful... Share this post Link to post Share on other sites
Tetraca 0 Report post Posted July 7, 2007 (edited) were doing a course in ICT called multimedia, but i dont know how to define variablesand whenever i ask my teacher he always goes "were not that far yet"he doesn't even look at what i have done, assumes I'm not finished, when i am, the only thing i need now is a scoring systemI'm guessing C++ is the language you are using.type name;Where type is the type of variable. Where name is the name of the variable. The type can be int for integers, float for real numbers, char for characters(it will only store one character if it isn't an array or pointer), and a host of various other types that you might not find useful under normal circumstances at this point. This is the basic way to declare variables in any C-like language(Java, C, C++, mainly) but PHP, and Perl which don't require variables to be defined.To assign a variable a value:name = value; Remember to put these in your functions like main() or it will be a global variable. Global variables are frowned upon in C. Edited July 7, 2007 by Tetraca (see edit history) Share this post Link to post Share on other sites
galexcd 0 Report post Posted July 7, 2007 In the description of the topic is what language he is talking about: "define variables in flash". So I'm guessing you mean actionscript. Now most programing languages are very similar when defining variables. Flash isn't as strict as c++ is so you do not need to put the type of variable when declaring it. To declare a variable in flash all you need to write is var variablename; After the variable is defined, you can then set it the same way you do it as shown above in both c++ and vb (and also pretty much every other language).variablename=value; Value can either be another variable, a string (text, which must be surrounded in quotations ex: variablename="text", or a number (there are many different value types for holding numbers, when you assign a number to a variable in flash it automatically assigns the variable to the correct type so you do not need to worry about it).I assume your class will go over this shortly along with all of the different variable types. Share this post Link to post Share on other sites