goto gosub ??

Non-platform specific questions.

goto gosub ??

Postby equinox » Sun Mar 08, 2009 9:05 am

Hi at ALL,

can be used and if so, some little line of code, please?

(goto....??
(gosub...??

Tnk1000.
User avatar
equinox
 
Posts: 118
Joined: Tue Jan 29, 2008 3:38 pm
Score: 0 Give a positive score

Re: goto gosub ??

Postby skydereign » Sun Mar 08, 2009 9:47 am

I don't know what you mean by gosub... Maybe you mean go[1], kind of thing, but you can't do that. goto works though. And if that is how you want to use it, goto works just the same way, you would just make it so.
Code: Select all
int i;
for (i=0; i<10; i++)
{
    //CreateActor()
}

Using goto,
Code: Select all
int i;
beginning:
//CreateActor();
i++;
if (i<10)
{
    goto beginning:
}
i=0;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: goto gosub ??

Postby pyrometal » Sun Mar 08, 2009 2:46 pm

gosub is not a valid C keyword! The purpose of a gosub statement is really to act as a kind of function abstraction in the languages which do use it. In C, gosub is useless since what it is used for is accomplished by defining custom functions.
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron