Error message in Global Code

Non-platform specific questions.

Error message in Global Code

Postby laddsa » Thu Jun 14, 2007 10:09 pm

Hi,

I have a very simple function prototype at the top of the global code editor, i.e

void countshots(int);

and have a funtion definition, i.e

void countshots(int shots)

{

//code will go here

}


If I save the ged file, close Game Editor (v. 1.3.7) then reopen GE, open the ged file and try to run it, then it says theres an error in the global code. When I check the global code I get the following error message:
'Redeclaration of parameter 'countshots'. Is there something that I am doing wrong?

Many thanks

Laddsa
laddsa
 
Posts: 22
Joined: Sun Jul 24, 2005 10:18 am
Score: 0 Give a positive score

Postby Sgt. Sparky » Thu Jun 14, 2007 10:11 pm

you cannot declare the same void twice(if you use both). :D
EDIT: or your code is wrong,
can you show me the code? :)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Fuzzy » Thu Jun 14, 2007 10:23 pm

You dont prototype in C/GE. Just go straight to

void countshots(int shots)

{

//code will go here

}
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

Postby laddsa » Thu Jun 14, 2007 10:39 pm

Thanks very much chaps. I shall try it without the function prototype and hopefully it will work!

Kind regards,

Laddsa
laddsa
 
Posts: 22
Joined: Sun Jul 24, 2005 10:18 am
Score: 0 Give a positive score

Postby Sgt. Sparky » Tue Jun 19, 2007 4:31 am

how is laddsa a name,
I mean:
is it a split name somthing like Lad Sah? :|
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest