function visualvalue for String/Alpha fields

Discussions about CSEntry
Yass
Posts: 46
Joined: November 11th, 2017, 1:26 am

function visualvalue for String/Alpha fields

Postby Yass » September 14th, 2018, 5:22 am

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: 1077
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: function visualvalue for String/Alpha fields

Postby Gregory Martin » September 14th, 2018, 11:12 am

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;


Return to “Entry”