cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Jaz
Jaz
Level V

Name Unresolved Error: Name Unresolved: lf in access or evaluation of 'lf' , lf

Hi,

I have a variable called lf, (lf = ListF << Get Items, where ListF is a list of items). I define ListF within a function that contains a button box. In the function for that button box, which is defined after the function where ListF is defined, I set lf = ListF << GetItems.  I can access the lf variable inside the functions but after the functions, when I write print(lf); it gives me this name unresolved error. Could you give me an idea as to why?

Function where ListF is defined:

selectFileButton = Function({y},
win1 = New Window( "Select Files",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "File To Tag", ListF << Append( ListData << GetSelected )),
ListF = List Box( fileSelected, width( lbWidth ), nLines( 5 ), Numeric ), 
Button Box("OK", OKScript1))));

Function where lf is defined:

OKScript1 = Expr(
	//win1 << CloseWindow;
	lf = ListF << Get Items);  

Outside both those functions:

 

print(lf); 

 

 

 

2 REPLIES 2
Jaz
Jaz
Level V

Re: Name Unresolved Error: Name Unresolved: lf in access or evaluation of 'lf' , lf

Still stuck on this, would really appreciate any help. Will provide the full code if needs be, thanks.

glenn_maxey0
Level I

Re: Name Unresolved Error: Name Unresolved: lf in access or evaluation of 'lf' , lf

Variable scope *might* be the issue. "lf" seems to be created and assigned a value inside of the eval chunk of code: a local variable. When that chunk of code is complete, garbage collection deletes the local variable.

Define "lf" and assign it a bogus value early so it becomes global. Then when are running the eval later, it won't define a local "lf" but a global "lf" that then the eval updates.

Recommended Articles