Lasso Soft Inc. > Home

[ thread_var_push ]

Method

[thread_var_push] creates a variables that is shared and accessible outside of any particular method call, yet is restricted to the currently executing thread. In addition, subsequent calls to [thread_var_push], with the same variable name, will create a variable "stack".

  • Syntax
thread_var_push( ::varName, #obj );
Examples
  • Beginner

Create a thread variable

The thread variable ::myVar is accessible within myMethod. Normally, a local variable would not be.

Code

define myMethod( ) => {
	return thread_var_get( ::myVar );
} // Close myMethod

thread_var_push( ::myVar, 'This is my thread var.' );	// Create thread var

myMethod( );	// Call myMethod

Result

This is my thread var.

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft