what is this??????????????????????????????

Discussion and feedback on Construct 2

Post » Tue Aug 12, 2014 5:01 pm

It's too bad you can't do something like this Set text Function.Param(0) | "Placeholder"
But instead have to do this Set text to Function.Param(0)?Function.param(0) : "Placeholder"
B
11
S
2
G
1
Posts: 202
Reputation: 1,580

Post » Tue Aug 12, 2014 5:21 pm

Noncentz705 wrote:It's too bad you can't do something like this Set text Function.Param(0) | "Placeholder"
But instead have to do this Set text to Function.Param(0)?Function.param(0) : "Placeholder"

It's even worse in javascript. You have to do:
Code: Select all
(Function != undefined && Function.param != undefined && Function.param[0] != undefined)?Function.param[0]:"Placeholder"

because undefineds don't "cascade". If your function is undefined, then trying to access "param" will result in an error, since "undefined" doesn't have a "param" attribute. The logical thing would be that a non-existant attribute of a non-existant object would be undefined, but browsers disagree.
B
36
S
8
G
8
Posts: 532
Reputation: 6,903

Post » Tue Aug 12, 2014 6:09 pm

OMG folks these escalated so quickly! Thanks all for the good reads! Gonna play around with all these tomorrow, see how I can exploit all these.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Tue Aug 12, 2014 6:11 pm

R0J0hound wrote:This works
Code: Select all
(time<5 | time>10)?"not now":"now"


OK, thanks.

Guess I should stop using those for delimiters. lol
Image ImageImage
B
170
S
50
G
179
Posts: 8,378
Reputation: 113,425

Post » Tue Aug 12, 2014 9:35 pm

DuckfaceNinja wrote:
codah wrote:@codah can you show a sample of writing it correctly since you said it is possible, for the sake of knowledge. :D


I started to but it was late. You can see now why I didn't bother :)

Noncentz705 wrote:It's too bad you can't do something like this Set text Function.Param(0) | "Placeholder"


I guess because that has another meaning.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests