"int" and "string"

Game Editor comments and discussion.

"int" and "string"

Postby asmodeus » Sun Nov 11, 2007 8:39 pm

How do I use "int" in the script editor and a variable, which is a string and what is the different from integer/real?
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: "int" and "string"

Postby Rux » Sun Nov 11, 2007 8:52 pm

Int is a non saved var maker. For example
Code: Select all
int var;
var = 0;
if(saved-var == 1)
{
var = 1;
}
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score

Re: "int" and "string"

Postby Game A Gogo » Mon Nov 12, 2007 12:34 am

"int" is not a non-saved var maker.

If you use int, it will declare an integer, if its in a script, it will be only usable in that script, if its in the global script, it will be used everywhere.

int can only hold whole number
if you want precision, float or double would be required.
and to declare a string, it would be "char*name;" or a limited string "char name[256];"
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: "int" and "string"

Postby Fuzzy » Mon Nov 12, 2007 9:53 am

Float or double can be inprecise. Very small or very large numbers may not be accurate.

A char is actually an short unsigned int. So a string is actually a array of 8 bit integers.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: "int" and "string"

Postby asmodeus » Mon Nov 12, 2007 12:06 pm

Thanks! :D
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score

Re: "int" and "string"

Postby Rux » Mon Nov 12, 2007 11:39 pm

Fuzzy wrote:Float or double can be imprecise. Very small or very large numbers may not be accurate.

A char is actually an short unsigned int. So a string is actually a array of 8 bit integers.


I see those letters like this: Bla or bla can be bla. Very small or very large numbers may not be accurate.

A bla is actually an short bla bla. So a bla is actually is a bla of 8 bit blas. XD (Note: This is only a joke not a message saying I don't know these words.)
I'm not good at coming up with signatures...
User avatar
Rux
 
Posts: 645
Joined: Sun Apr 29, 2007 9:26 pm
Location: Sitting on your moniter invisable.
Score: 35 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron