Sidebar

What is the syntax for hard-coding a value

0 votes
353 views
asked Jul 18, 2019 by gary-h-3646 (180 points)
To send a static value assigned by the registry, does the value go inside single quotes? If the value is ABC123, which of the following goes in the Value field?

ABC123

'ABC123'

2 Answers

0 votes

Yes, the value goes inside the quotes. If the value field does not have quotes then QIE assumes it is a variable. In order to set MSH-4 use:

message.setNode('MSH-4', 'ABC123');

answered Jul 18, 2019 by amanda-w-3695 (4,840 points)
0 votes

Just to clarify, quotes are used within JavaScript to represent a static value.  So, if you are writing JavaScript, and calling Code Wizard functions, then you would need to quote a static value.

However, if you are dealing with a field that is in the UI, the value won't be quoted.

Here is an example of setting an unquoted value in the String field, and how that gets quoted in the generated JavaScript code.

Quoted versus Unquoted Static Value

answered Jul 18, 2019 by mike-r-7535 (13,830 points)
...