function visualvalue for String/Alpha fields

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

function visualvalue for String/Alpha fields

Post by Yass »

Hi Cspro Team,

I will like to use the function visualvalue to check if there exist a text in a field before sysparm to populate. It works with numeric
which the Help indicate, what is the alternative for string. I had this :

preproc

Code: Select all

if visualvalue($) = " " then
if sysparm("HeadHousehold") <> " " then
    $ = sysparm("HeadHousehold");
endif;
endif
I get the error below:

ERROR: Invalid variable type - numeric variable expected near line 2 in S3Q8A procedure
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: function visualvalue for String/Alpha fields

Post by Gregory Martin »

When querying the value of a string field, you will always get the "visual value." So you can just do:
if $ = "" and sysparm("HeadHousehold") <> "" then
    $ = sysparm("HeadHousehold");
endif;
Post Reply