Page 1 of 1

Run user functions on dynamic dictionary items?

Posted: September 30th, 2012, 8:16 am
by pierrew
Another question?

Here is the dilemma. I created a function that checks if the items entered by the user are valid. If they are not valid the error message is written to a an external file via a specified dictionary.

So ...
Is it possible to pass the address of a dictionary item? ... for example - I have many items that are required [AGE], [SEX], [BIRTHMONTH] ... instead of writing error messages, if the user input is invalid, under each postproc, I want to call a function outOfScope($) which checks if the data is "invalueset($)".
the function will look something like this ...

Code: Select all

function outOfScope(alpha tmpItem)
    if !invalueset(strip(tmpItem)) then
       //code to write to file
    endif;
end;
This function will not work because the function invalueset is expecting a dictionary item and not another function. The code will compile correctly if I remove the "strip" function but I am guess the trailing spaces will cause the program to crash. One more thing I cannot use the current item "$" because I will run the function from an item that is not related to the actual Item that need to be checked for errors.

Anybody got any ideas or suggestions?

Thanks
Pierre