Bug: Runtime Error

Non-platform specific questions.

Bug: Runtime Error

Postby Bee-Ant » Tue Sep 28, 2010 3:47 pm

Here's the code in the following error line:
Code: Select all
CatalogList[i]=(i<82)?i-2:82;
Attachments
error.png
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Bug: Runtime Error

Postby DST » Tue Sep 28, 2010 11:07 pm

lol yes, that's exactly what happened to me with code fuzzy told me about, the whole (x<y)? thing.....

I blame fuzzy. Just...because.

Hear that fuzz!? You are the cause of all my problems in this life! :P
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: Bug: Runtime Error

Postby Bee-Ant » Wed Sep 29, 2010 12:25 am

I thought it's same thing with % where we can't use the same operand inside the formula, so I changed it to
Code: Select all
ii=i;jj=i-2;
CatalogList[i]=(ii<82)?jj:85;

But didn't help at all...darn :x

DST wrote:lol yes, that's exactly what happened to me with code fuzzy told me about, the whole (x<y)? thing.....
I blame fuzzy. Just...because.
Hear that fuzz!? You are the cause of all my problems in this life! :P

That's true...in this case, he's a failed teacher :P
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Bug: Runtime Error

Postby DST » Wed Sep 29, 2010 1:32 am

Fuzzy has taught me more than you could know. He is the best teacher i've ever had.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: Bug: Runtime Error

Postby Bee-Ant » Wed Sep 29, 2010 6:10 am

He treated us differently it seems...
For me, he just suggested me better method to do things. He pushed me to think deeper and then finally I solved the problem myself...
As if he just pushed me to find my own way, lucky you Dee :|
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Bug: Runtime Error

Postby Fuzzy » Wed Sep 29, 2010 7:04 am

Code: Select all
CatalogList[i] = (i<82)?i-2:82;


is wrong

try

Code: Select all
CatalogList[i] = (i<82)?(i-2):82;


next time you LISTEN when I teach things. :P
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: Bug: Runtime Error

Postby Bee-Ant » Wed Sep 29, 2010 8:07 am

Fuzzy wrote:
Code: Select all
CatalogList[i] = (i<82)?(i-2):82;

next time you LISTEN when I teach things. :P


Bee-Ant wrote:
Code: Select all
ii=i;jj=i-2;
CatalogList[i]=(ii<82)?jj:85;


See who's not listening here???
Both method should make the same sense...that's why they both didn't work :wink:

LISTEN CAREFULLY NOW,
Code: Select all
xxx = (i<82)?i-2:82;

Is NOT wrong

Here's the code that works
Code: Select all
ii=(i<82)?i-2:85;
CatalogList[i]=ii;


The main problem is, we can't put an array into the formula directly 8)
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Bug: Runtime Error

Postby Fuzzy » Wed Sep 29, 2010 8:12 am

Oh I see. That is strange isnt it?

I tested it with a regular int variable so GE never complained.
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


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest