Re: [NTLK] NewtonScript trouble

From: Simon Bell <simonbell_at_mac.com>
Date: Wed Aug 27 2008 - 08:29:59 EDT

On 27 Aug 2008, at 12:18, RedJazz wrote:

> func()
> begin
> local heapReport;
> GC();
> heapReport := Stats() && " bytes";
> return heapReport;
> SetValue(wHeapShow, 'text, heapReport);
> end
>
> According to some info on the Web, this should work. But when I run
> it, It gives me the error -48807 (undefined variable).

The code you’ve written is fine; indeed it works if you execute it in
the NTK Inspector. But you’re returning from the function before the
SetValue call, and I suspect that without that return the undefined
variable is wHeapShow. Have you declared wHeapShow to a containing
view, and is your function in that containing view?

Simon

====================================================================
The NewtonTalk Mailing List - http://www.newtontalk.net/
The Official Newton FAQ - http://www.splorp.com/newton/faq/
The Newton Glossary - http://www.splorp.com/newton/glossary/
WikiWikiNewt - http://tools.unna.org/wikiwikinewt/
====================================================================
Received on Wed Aug 27 08:30:19 2008

This archive was generated by hypermail 2.1.8 : Wed Aug 27 2008 - 09:30:00 EDT