I think you overlooked this post:
admin wrote: ↑28 Aug 2020 16:42
Code: Select all
* SC get("bitness"): Changed the return from numbers to a full string (not
translated by MSL so you know what to expect), and added 2 new cases so we
have 5 possible returns now:
"16-bit"
"32-bit"
"64-bit"
"64-bit Itanium"
"(unknown)"
Tip: In a Custom Column you can use this line in the Script field:
return get("bitness", <cc_item>);
So
get("bitness") no longer returns a number (64) , but a textstring ("64-bit").
Taht makes comparisons different.
Compare variable with a number: if ($variable == 123)
Compare variable with text: if ($variable == "some text")
If you only want to see 32-bit and 64-bit in the cusom column (so no 16-bit, 64-bit Itanium), you can use the following:
Code: Select all
$bits = get("bitness", <cc_item>);
if ($bits == "32-bit") {
return "32-bit";
} elseif ($bits == "64-bit") {
return "64-bit";
} else {
return "unknown";
}
Same results, but less typing:
Code: Select all
$bits = get("bitness", <cc_item>);
if ($bits == "32-bit" OR $bits == "64-bit") {
return $bits;
} else {
return "unknown";
}
If you want to see all possible bitnesses (??):
Code: Select all
$bits = get("bitness", <cc_item>);
return $bits;
or even: