R3DActual 0 Posted October 12, 2021 So, I'm working on trying to get it where it checks for both an empty value and checks to make sure the value is a number/int from an RscEdit Reading if it's empty works fine but checking to see if it's an int/SCALAR no matter whether it's a number or text or returns the hint "Value must be an integer!" _getVar = uiNamespace getVariable 'myVar'; _value = ctrlText _getVar; if (_value == "") exitWith { hint parseText "<t color='#FF0000'>Value can't be empty!</t>"; }; if(typename _value != "SCALAR") exitWith { hint parseText "<t color='#FF0000'>Value must be an integer!</t>"; }; hint format["Value: $%1", _value]; Share this post Link to post Share on other sites
beno_83au 1369 Posted October 13, 2021 Always check the biki - https://community.bistudio.com/wiki/ctrlText As you can see from the command's return value it always returns a string, so typeName will always return "STRING". You are going to need to convert the string to a number first using parseNumber: _getVar = uiNamespace getVariable 'myVar'; _value = ctrlText _getVar; if (_value == "") exitWith { hint parseText "<t color='#FF0000'>Value can't be empty!</t>"; }; _num = parseNumber _value; hint format["Value: $%1", _num]; Share this post Link to post Share on other sites