You are not logged in.    Login    New User    Forum Home    Search

Location:
JBPLAY  \  Meteor 2  \  General  \  atoi and itoa

Back to Threads

Viewing Thread: atoi and itoa

 

arezey

Joined: 16 June 2005
Posts: 1599
07 February 2006 17:31 (UK time)

I am doing a map for the M2 MP Contest. I've somehow worked it out so that I'm going to need the <I>atoi</I> and <I>itoa</I> in my script.

This is my prob: how I get Meteor understanding that the SET_HIDDEN is an integer? Or how I use atoi or itoa?

EDIT: OK, I got it. But Meteor can't deal with atoi?

Compile Error: ************ (14) Error[V:\seer\src\Expr.c:1688]: Ži' undeclared
Line: i = atoi( s );

this is a part from my script. Atoi is needed when I want to make a script for my map because I don't want to write "for" with it's parameters everytime.

// make a script, is needed
void SC_SetMultipleObjects(int LowestObjectId, int HighestObjectId, char SettingType, int SettingValue)
{
int Objects;

char *s;

s = SettingType;
i = atoi( s );

EDIT: OK, I'll use numbers and use the #define function to let me use the SET_ values. But I would like to have Meteor work on atoi too.

Edited: 07 February 2006 17:43


You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
10 February 2006 00:21 (UK time)

Yes it does itoa and atoi (pretty sure it does).

Your problem is simply that you did not declare the integer variable <b>i</b>.

Try this...

void SC_SetMultipleObjects(int LowestObjectId, int HighestObjectId, char SettingType, int SettingValue)
{
int Objects;
<b>int i;</b>
char *s;

s = SettingType;
i = atoi( s );
}

Edited: 10 February 2006 00:22


You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
10 February 2006 11:05 (UK time)

Did I forget it? I must have been tired at that time.

Well, I quess I should thank you for reminding for my... problem.

EDIT: I fixed it by adding the int i; line, but now comes:
Compile Error: ************ (15) Error[V:\seer\src\Expr.c:1688]: Žatoi' undeclared
Line: i = atoi( s );

Edited: 10 February 2006 11:49


You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
10 February 2006 17:20 (UK time)

Dah OK it looks like I need to add atoi,itoa,atof etc to the supported functions.

You need to login to create posts in this thread.

arezey

Joined: 16 June 2005
Posts: 1599
12 February 2006 08:22 (UK time)

Wait. It came also to any other function like "'SC_SetObjectHidden' undeclared" and so on. I found out on my script that I forgot to put #include meteor2 into it! I <B>must</b> have been tired at that time! I'll test out does atoi work.

OK. This time this is different

Edited: 12 February 2006 08:27


You need to login to create posts in this thread.



Forums system (C) 1999-2023 by James Bunting.

Terms of Use