Hello!

I was wondering if there's any function or something that can help me check if a numeric variable is completly filled.

For example:

"numericVariable" is a numeric variable of length 8. That variable must always have all its length filled. Does CSPRO have any function that checks that or anyone knows how it can be done?

Thank you!

## Checking if a numeric variable is completly filled

### Re: Checking if a numeric variable is completly filled

Hi,

This issue has been solved. Please see:

viewtopic.php?f=1&t=1875&p=5832&hilit=length+numeric#p5829

To have the length of entered value, please use mathematic function such as the Log Function .

Then compare the maxvalue and the result of the mathematical operation.

For more, please see https://stackoverflow.com/questions/306 ... teger-in-c

Best Regards,

This issue has been solved. Please see:

viewtopic.php?f=1&t=1875&p=5832&hilit=length+numeric#p5829

To have the length of entered value, please use mathematic function such as the Log Function .

Then compare the maxvalue and the result of the mathematical operation.

For more, please see https://stackoverflow.com/questions/306 ... teger-in-c

Best Regards,

Last edited by htuser on May 8th, 2019, 2:54 pm, edited 1 time in total.

### Re: Checking if a numeric variable is completly filled

That depends on how you define "completely filled". Is it allowed to have leading zeros? If not then you can simply check if it is greater than or equal 10000000 since any 8 digit number must be at least that big. If it can have leading zeros then you really aren't talking about number in the mathematical sense. There you want a string of 8 digits like a phone number or an account number. In that case, make the item type alphanumeric and use a regular expression to check that it is 8 characters long and only numeric. Something along the lines of:

Check out this blog post for more info on regular expressions: http://www.csprousers.org/posts/2019-02 ... sions.html

if not regexmatch(MYFIELD, "^[0-9]{8}$") = 0 then

Check out this blog post for more info on regular expressions: http://www.csprousers.org/posts/2019-02 ... sions.html