Conditions and Functions in Code Block

Nick, a solution to the Imperative code block issue can be found in this discussion on the forum.

It is possible to reference variables, however, those references need to be brought in as input parameters in the function being defined.

In your example, for the function to return linepreview, it first needs to have linepreview brought in as an input parameter

def active(linepreview)

{

return=linepreview;

};


Important: This example serves no real purpose and does not in any way demonstrate the purpose or utility of functions. The utility of the example is limited to the issue raised here.

 

 

Hi Vikram,

Unfortunately, the link is broken.

I am importing Excel-data and would like to use functions to call lists instead of carrying the data throughout the sciprt. Is this possible?

link

here

Or here, for a live link to the forum instead of Archive.org:

Apparently forum permalink formats changed sometime in the past 6 years, but the search box up top still finds it!