PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Rob on October 23, 2025, 12:24:34 PM

Title: JSON get_num validation
Post by: Rob on October 23, 2025, 12:24:34 PM
How does GET_NUM(KEY$,validation) work if validation is on?

Do you get an ERROR 11 for a missing key?
Title: Re: JSON get_num validation
Post by: Aaron Woodhouse on October 24, 2025, 09:14:52 AM
Hi Rob!

Using the get_num function normally without the no_validation flag will return an error 11 if the key doesn't exist. It does some checks within the object's keys to make sure your provided key will work.

If you use the no_validation flag, it will skip this initial key check, and instead return an error 23 since it can't actually find the value.

It will return an error either way, but the key validator would tell you the issue is due to the key, not that there is no value.