<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Dynamic updates to GB via AddGraphicsScript and Eval/Expr - throwing &amp;quot;Name Unresolved&amp;quot; in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Dynamic-updates-to-GB-via-AddGraphicsScript-and-Eval-Expr/m-p/845133#M101979</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;namesdefaulttohere(1);
try(nw3&amp;lt;&amp;lt;close window);

toggle = expr(
	x = random integer(10,90);
	y = random integer(10,90);
	
	foreach({key}, map,
		gb = map[key];
		f = gb[framebox(1)];
		f &amp;lt;&amp;lt; add graphics script(
			eval(expr( text({x,y}, key) ))
		)
	)
);

vlb = vlistbox();
map = [=&amp;gt;];

foreach({alpha}, words("a b c"),
	map[alpha] = graphbox(suppress axes, frame size(100,100));
	vlb&amp;lt;&amp;lt;append( map[alpha] )
);

nw3 = new window("ex",outlinebox("what",
	{"toggggggle", toggle},
	vlb
))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Name Unresolved: key in access or evaluation of 'key' , key/*###*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Mar 2025 23:33:15 GMT</pubDate>
    <dc:creator>mtowle419</dc:creator>
    <dc:date>2025-03-01T23:33:15Z</dc:date>
    <item>
      <title>Dynamic updates to GB via AddGraphicsScript and Eval/Expr - throwing "Name Unresolved"</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-updates-to-GB-via-AddGraphicsScript-and-Eval-Expr/m-p/845133#M101979</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;namesdefaulttohere(1);
try(nw3&amp;lt;&amp;lt;close window);

toggle = expr(
	x = random integer(10,90);
	y = random integer(10,90);
	
	foreach({key}, map,
		gb = map[key];
		f = gb[framebox(1)];
		f &amp;lt;&amp;lt; add graphics script(
			eval(expr( text({x,y}, key) ))
		)
	)
);

vlb = vlistbox();
map = [=&amp;gt;];

foreach({alpha}, words("a b c"),
	map[alpha] = graphbox(suppress axes, frame size(100,100));
	vlb&amp;lt;&amp;lt;append( map[alpha] )
);

nw3 = new window("ex",outlinebox("what",
	{"toggggggle", toggle},
	vlb
))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Name Unresolved: key in access or evaluation of 'key' , key/*###*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Mar 2025 23:33:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-updates-to-GB-via-AddGraphicsScript-and-Eval-Expr/m-p/845133#M101979</guid>
      <dc:creator>mtowle419</dc:creator>
      <dc:date>2025-03-01T23:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic updates to GB via AddGraphicsScript and Eval/Expr - throwing "Name Unresolved"</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamic-updates-to-GB-via-AddGraphicsScript-and-Eval-Expr/m-p/845143#M101980</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Figured it out. Rather than reach for the value of `key` at eval time, we can save it when initializing the GB. Here, we're calling it `beta`, but key/beta are just references to one of words("a b c")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;toggle = expr(
	x = random integer(10,90);
	y = random integer(10,90);
	
	foreach({key}, map,
		gb = map[key];
		f = gb[framebox(1)];
		f &amp;lt;&amp;lt; add graphics script(
			eval(eval expr( text({x,y}, expr(beta)) )) // change #1
		)
	)
);


vlb = vlistbox();
map = [=&amp;gt;];

foreach({alpha}, words("a b c"),
	map[alpha] = eval(eval expr(graphbox(suppress axes, frame size(100,100),

		beta = expr(alpha); // change #2 (plus wrapping GB in eval/eval expr
		
	)));
	vlb&amp;lt;&amp;lt;append( map[alpha] )
);

nw3 = new window("ex",outlinebox("what",
	{"toggggggle", toggle, "toggle2", toggle2},
	vlb
))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Mar 2025 00:04:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamic-updates-to-GB-via-AddGraphicsScript-and-Eval-Expr/m-p/845143#M101980</guid>
      <dc:creator>mtowle419</dc:creator>
      <dc:date>2025-03-02T00:04:27Z</dc:date>
    </item>
  </channel>
</rss>

