cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-62240%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EErreur%20de%20nom%20non%20r%C3%A9solu%26nbsp%3B%3A%20nom%20non%20r%C3%A9solu%26nbsp%3B%3A%20lf%20dans%20l'acc%C3%A8s%20ou%20l'%C3%A9valuation%20de%20'lf'%20%2C%20lf%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-62240%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESalut%2C%3C%2FP%3E%3CP%3EJ'ai%20une%20variable%20appel%C3%A9e%20lf%2C%20(lf%20%3D%20ListF%20%26lt%3B%26lt%3B%20Get%20Items%2C%20o%C3%B9%20ListF%20est%20une%20liste%20d'%C3%A9l%C3%A9ments).%20Je%20d%C3%A9finis%20ListF%20dans%20une%20fonction%20qui%20contient%20une%20bo%C3%AEte%20%C3%A0%20boutons.%20Dans%20la%20fonction%20de%20cette%20bo%C3%AEte%20%C3%A0%20boutons%2C%20qui%20est%20d%C3%A9finie%20apr%C3%A8s%20la%20fonction%20o%C3%B9%20ListF%20est%20d%C3%A9finie%2C%20j'ai%20d%C3%A9fini%20lf%20%3D%20ListF%20%26lt%3B%26lt%3B%20GetItems.Je%20peux%20acc%C3%A9der%20%C3%A0%20la%20variable%20lf%20%C3%A0%20l'int%C3%A9rieur%20des%20fonctions%20mais%20apr%C3%A8s%20les%20fonctions%2C%20quand%20j'%C3%A9cris%20print(lf)%3B%20il%20me%20donne%20ce%20nom%20d'erreur%20non%20r%C3%A9solue.%20Pourriez-vous%20me%20donner%20une%20id%C3%A9e%20du%20pourquoi%3F%3C%2FP%3E%3CP%3EFonction%20o%C3%B9%20ListF%20est%20d%C3%A9fini%26nbsp%3B%3A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EselectFileButton%20%3D%20Function(%7By%7D%2C%0Awin1%20%3D%20New%20Window(%20%22Select%20Files%22%2C%0ALineup%20Box(%20N%20Col(%202%20)%2C%20Spacing(%203%20)%2C%0AButton%20Box(%20%22File%20To%20Tag%22%2C%20ListF%20%26lt%3B%26lt%3B%20Append(%20ListData%20%26lt%3B%26lt%3B%20GetSelected%20))%2C%0AListF%20%3D%20List%20Box(%20fileSelected%2C%20width(%20lbWidth%20)%2C%20nLines(%205%20)%2C%20Numeric%20)%2C%20%3CBR%20%2F%3EButton%20Box(%22OK%22%2C%20OKScript1))))%3B%20%3CBR%20%2F%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EFonction%20o%C3%B9%20lf%20est%20d%C3%A9fini%26nbsp%3B%3A%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EOKScript1%20%3D%20Expr(%0A%20%2F%2Fwin1%20%26lt%3B%26lt%3B%20CloseWindow%3B%0A%20lf%20%3D%20ListF%20%26lt%3B%26lt%3B%20Get%20Items)%3B%20%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EEn%20dehors%20de%20ces%20deux%20fonctions%26nbsp%3B%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Eprint(lf)%3B%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Courier%20New%22%20size%3D%222%22%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-65618%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%26nbsp%3B%3A%20Nom%20non%20r%C3%A9solu%20Erreur%26nbsp%3B%3A%20Nom%20non%20r%C3%A9solu%26nbsp%3B%3A%20lf%20dans%20l'acc%C3%A8s%20ou%20l'%C3%A9valuation%20de%20'lf'%20%2C%20lf%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-65618%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ELa%20port%C3%A9e%20variable%20*pourrait*%20%C3%AAtre%20le%20probl%C3%A8me.%20%22lf%22%20semble%20%C3%AAtre%20cr%C3%A9%C3%A9%20et%20assign%C3%A9%20une%20valeur%20%C3%A0%20l'int%C3%A9rieur%20du%20morceau%20de%20code%20eval%20%3A%20une%20variable%20locale.%20Lorsque%20ce%20morceau%20de%20code%20est%20termin%C3%A9%2C%20la%20r%C3%A9cup%C3%A9ration%20de%20place%20supprime%20la%20variable%20locale.%3CBR%20%2F%3E%3CBR%20%2F%3E%20D%C3%A9finissez%20%22lf%22%20et%20attribuez-lui%20une%20fausse%20valeur%20t%C3%B4t%20pour%20qu'il%20devienne%20global.%20Ensuite%2C%20lors%20de%20l'ex%C3%A9cution%20de%20l'eval%20plus%20tard%2C%20il%20ne%20d%C3%A9finira%20pas%20un%20%22lf%22%20local%20mais%20un%20%22lf%22%20global%20qui%20sera%20ensuite%20mis%20%C3%A0%20jour%20par%20l'eval.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-62246%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%26nbsp%3B%3A%20Nom%20non%20r%C3%A9solu%20Erreur%26nbsp%3B%3A%20Nom%20non%20r%C3%A9solu%26nbsp%3B%3A%20lf%20dans%20l'acc%C3%A8s%20ou%20l'%C3%A9valuation%20de%20'lf'%20%2C%20lf%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-62246%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EToujours%20bloqu%C3%A9%20sur%20ce%20point%2C%20j'appr%C3%A9cierais%20vraiment%20toute%20aide.%20Fournira%20le%20code%20complet%20si%20besoin%20est%2C%20merci.%3C%2FP%3E%3C%2FLINGO-BODY%3E
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