Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Components
Assignee
Gavin HallidayGavin HallidayReporter
Todd LeonardTodd LeonardPriority
MinorPull Request URL
Details
Details
Components
Assignee
Gavin Halliday
Gavin HallidayReporter
Todd Leonard
Todd LeonardPriority
Pull Request URL
Created October 29, 2015 at 2:13 PM
Updated February 10, 2016 at 6:16 PM
Resolved November 16, 2015 at 12:50 PM
For the following code...
toText(UNSIGNED1 i) := CHOOSE(i,'one','two','elsevalue');
OUTPUT(toText(0));
OUTPUT(toText(1));
OUTPUT(toText(2));
OUTPUT(toText(3));
OUTPUT(toText(4));
The values 1 and 2 yield their counterparts, and the values 3 and 4 yield 'elsevalue' as expected. However, passing 0 yields 0.
Shouldn't passing 0 yield 'elsevalue'?
I do see I'm violating the expected type of input, as the first parameter is described in the user's guide as "An arithmetic expression that results in a positive integer and determines which value parameter to return". However, given the elsevalue is broadly described as "The value to return when the expression returns an out-of-range value", it seems more logical to return it rather than lapse into undefined behavior.