Procedure returning values

Hi. I'm trying to define a function (procedure that returns a result) and a number of the examples I've seen use a 'do-result' block with a lug on the left side to fit into an 'initialize-local' block. However this 'do-result' block doesn't appear in my Control section.

Did you set toolkit to Default in your project properties?
Taifun


Should be here.

this is the Block to set up a Procedure:

initialize local name to - in (return)

This block is a mutator that allows you to create new variables that are only used in the procedure you run in the RETURN part of the block. This way all variables in this procedure will all start with the same value each time the procedure is run. NOTE: This block differs from the block described above because it is a RETURN block. You can attach expressions to it. Expressions return a value. That is why this block has a socket for plugging in expressions.

You can rename the variables in this block at any time and any corresponding blocks elsewhere in your program that refer to the old name will be updated automatically

as discussed in Procedure returning values

I call this the procedure sandwich because of its three layer structure:

Procedure definition block on the outside, then local variables if needed, then do result on the inside.

1 Like

That was the problem, thanks although I'm unclear why with all the toolkit options ticked some blocks disappear!

1 Like