Write variables with a zero value
Alistair Nicoll from New Zealand  [2 posts]
4 months
Hi Steven,
I'm using the Write_Variables function to create a CSV file of the number of labels I've detected on fruit. It works fine if the number is >1. However if there are zero labels I don't get a zero in the log file, I just get "". I tried logging other variables as well and any number that was a zero got the same result. Any number greater than zero logged correctly.
What am I doing wrong?
STeven from United States  [1403 posts] 2 months

Within RR there isn't a restriction of type ... which allows a variable to contain a zero or a null string. So a "" is treated the same as 0. I.e. the variable has NO value.

To resolve this you can check the variable prior to saving it for a "" and then set it to 0 or "0" which will then cause it to log the digit. You can probably use a If_statement module or the VBScript module to check for this issue prior to the Write_Variables module.


 Reply  New Post   Forum Index