|
Lets say that Ord is already defined and Fourth is already defined. Then, we have tableOfIntValues with 3 IntValues saved in it, with a possibility of having 4 IntValues saved in it. Would this work?
ord.Fourth.Value = tableOfIntValues[4].Parent.Name or "nil" |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
ord.Fourth.Value = (tableOfIntValues[4] == nil and "nil" or tableOfIntValues[4].Parent.Name)
x = (1 < 2 and "hi" or "bye")
print(x) -->hi
Its like
x = condition and option1 or option2
If condition is true it goes with option1, if condition is false it goes with option 2 |
|
|
Doesn't appear to be working....
|
|
|
No error messages, but when I check the "First" value, it doesn't say anything... |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
No error messages, but when I check the "First" value, it doesn't say anything...
What |
|
|
Its a string value and its Value property reads " " |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
Well I just tested it and it worked fine |
|
|
Perhaps I tested it wrong...? or does it work if I put the table in a function inside a function, then called the table outside both functions?
|
|
|
nvm found a tiny little typo in the beginning of my 300 line script :/ ill see if fixing it made it work. |
|
|
nvm that generated another error. Oh well, ill find the problem soon... |
|
|
Oh yeah, what would it do if the values are equal? |
|
128GBJoin Date: 2014-04-17 Post Count: 8056 |
What do you mean? |
|
|
like this:
a.Value = 5
b.Value = 5 |
|
|
I found a temporary solution, but I was wondering if there was another way. (I changed > to >=) |
|
|
Values still aren't working. Maybe if i did tostring()...? |
|