cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Due to global connectivity issues impacting AWS Services, users may experience unexpected errors while attempting to authorize JMP. Please try again later or contact support@jmp.com to be notified once all issues are resolved.

Discussions

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

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 IV

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