<div dir="ltr">I see the message I'm trying to capture is written to the Transcript in the <font face="monospace">UndeclaredVariableWarning</font> instance method <font face="monospace">defaultAction</font>.<div>So it doesn't exist as the value of any instance variable I can access.</div><div>I don't see an easy way to get such error messages from <font face="monospace">Compiler evaluate:</font>.</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Jan 17, 2025 at 4:50 PM Mark Volkmann <<a href="mailto:r.mark.volkmann@gmail.com">r.mark.volkmann@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks! That allows me to avoid writing an error message to the Transcript.<div>The other thing I want to do is get the er<font face="arial, sans-serif">ror message ("x is Undeclared" in this case) so I can display it in my UI.</font></div><div><font face="arial, sans-serif">Do you know how I can get that?</font></div><div><font face="arial, sans-serif">I don't see that in any of the instance variables associated with either exception object.</font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 17, 2025 at 12:46 PM Weslleymberg Lisboa via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi, Mark<br>
<br>
I found 'is Undeclared' in UndeclaredVariableWarning>>defaultAction <br>
which seems to match what you see in the transcript.<br>
<br>
I was able to get rid of the transcript error message by doing:<br>
<br>
expression := '1 + x'.<br>
[ Compiler evaluate: expression ] on: UndeclaredVariableWarning do: [:ex <br>
| ex resume: false] on: Error do: [:ex | ex inspect ]<br>
<br>
To give a little context, I searched for references to the class <br>
UndeclaredVariableWarning. One of the results was Encoder>>#undeclared: <br>
where the comments mention how to disable the warning.<br>
<br>
Em 17/01/2025 09:40, Mark Volkmann via Cuis-dev escreveu:<br>
> In a Workspace, if I "Do It" the first expression below and "Print It" <br>
> the second expression, it prints 3 as expected.<br>
> <br>
> expression := '1 + 2'.<br>
> [ Compiler evaluate: expression ] on: Error do: [ :ex | ex inspect ].<br>
> <br>
> Now if I change the 2 in expression to x and repeat, it prints <br>
> the following:<br>
> <br>
> MessageNotUnderstood: UndefinedObject>>adaptToNumber:andSend:<br>
> <br>
> It also writes the following to the Transcript:<br>
> <br>
> UndefinedObject>>DoIt (x is Undeclared)<br>
> <br>
> Looking in the Inspect window I see that none of the instance variables <br>
> contain "x is Undeclared". I really want to get that string. I've <br>
> searched the Compiler methods and haven't found a way to do this. Does <br>
> anyone know how I could access that error message?<br>
> <br>
> I'd also like to prevent the error message from being written to the <br>
> Transcript so I can completely handle it in my code.<br>
> <br>
> -- <br>
> R. Mark Volkmann<br>
> Object Computing, Inc.<br>
> <br>
<br>
-- <br>
Wéslleymberg Lisboa<br>
Graduado em Sistemas de Informação<br>
Docente no IFFluminense - Campus Itaboraí<br>
<br>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div>