Help with operator?: bug

New releases and general discussions.

Post » Tue Feb 17, 2009 12:46 am

Hey,

I've been trying to look in to a crash with the ?: conditional expression which has been reported but all the trivial .caps I make using it seem to work fine. Can anyone provide a .cap which crashes using the ?: operator?

You can use it like:

(a < b) ? "A less than B" : "A greater/equal B"

The conditional has to be in brackets because I suck with parsers and can't figure out how to make the order of operations work for ternary operators. (If you don't put brackets it'll probably say invalid expression)

Remember, as few events and objects as possible is best! Thanks!
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578


Post » Tue Feb 17, 2009 2:01 am

Yeah thats the one, thanks... dunno why it worked for my example but that one definitely crashes!
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Tue Feb 17, 2009 2:08 am

Strange.. but I guess something's changed in the new version that you're using?
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Tue Feb 17, 2009 2:10 am

Oh damn, this is why: it doesn't crash when I make a debug build. This is gonna be difficult...
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Tue Feb 17, 2009 2:14 am

Now the fun begins ;)
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Tue Feb 17, 2009 2:15 am

Hmm, actually I think I fixed it! :)
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Tue Feb 17, 2009 7:57 am

Oh yeah, I was using this operator yesterday with the text object...

Set Text to Random(2)?"Shrubbery":"Marmalade"
I expected it to return either "Shrubbery" or "Marmalade", but... It crashed.

If you fixed it, I needn't worry anymore :)
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue Feb 17, 2009 1:10 pm

Yeah that'll be great if he fixed it. I didn't even know it existed until he posted. I should read the wiki/docs more!
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Thu Feb 19, 2009 1:19 am

[quote="Ashley":1a13l4p5]Hmm, actually I think I fixed it! :)[/quote:1a13l4p5]

What was wrong? Was it the HTML codes?
Image Image
Scirra Founder
B
124
S
37
G
25
Posts: 3,945
Reputation: 44,897

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests