Parameters, variables, procedures?

I’m having a terrible time understanding how to handle passing variables (parameters?) to a procedure.

Here is my code.

\procedure get-breed(breed)
<$action-log breedName=<<breed>> />
\end get-breed

<$button actions=<<get-breed breed:"lab">> >
Choose a breed
</$button>

What I would expect from this is for the breed name (lab) to be output in the $action-log message. However this never happens. The breed variable I’m passing in doesn’t seem to be recognized at all.

What am I doing wrong? I’m very new at this so I’m sure there is some underlying TW concept I’m not getting.

it looks to be an issue with the space in the actions attribute (between get-breed and breed:lab>>. if you want to put a space in an attribute it needs quotes:

\procedure get-breed(breed)
<$action-setfield breedName=<<breed>> />
\end get-breed

<$button actions="""<<get-breed breed:lab>>""">
Choose a breed
</$button>

this works for me. i put triple double quotes """ so that it doesn’t break if the breed has a space, like this:

<$button actions="""<<get-breed breed:"great dane">>""">
Choose a breed
</$button>
1 Like

The triple quotes did the trick. Thanks.

1 Like