[NTLK] Methods in the app's base view - how do I actually INVOKE them?

From: Anthony Martinez <pi_at_pihost.us>
Date: Fri Oct 03 2008 - 22:18:29 EDT

I've started working on my first NewtonScript app, using NTK1.6 on
Windows. I've got a function nstrToCstr defined as such on my app's main
frame/base view (copied and slightly trimmed from an export-to-text of my
project)

myApp := {
     nstrToCstr:
       func(str)
           begin
               StuffCString(MakeBinary(StrLen(str)+1, 'binary), 0, str);
           end,
     _proto: @157
    };

However, trying to call that function from inside, say, a
buttonClickScript, I just can't do it. I've tried saying
    x := nstrToCstr(foo); /* NewtonScript compiler complains about undefined global function */
    x := myApp:nstrToCstr(foo); /* Compiles, but newton gives an undefined variable error */
    x := |myApp:MTP|.nstrToCstr(foo); /* Compiles, but newton gives an "expected frame, got nil" sort of error */
and variations thereon, and I just can't seem to do it.

I've also tried declaring this function (nstrToCstr := func...) in
another file and putting it before my main layout in the compilation
order, with the same undefined-global-function error. I'd rather not
create a truly global function, since as I understand that's rather
antisocial.

I'm sure I'm missing something trivial here, but studying the
documentation didn't really shed any light on this, nor could I find
example code that seemed to do this.

Thanks in advance,
Pi

-- 
   + ,*                                           
  _  /        I DEFY ANYONE TO IDENTIFY           
 ' `-' +      WHAT THIS IS SUPPOSED TO BE
   /  +                                           
==================================================================== 
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 Fri Oct 3 22:50:34 2008

This archive was generated by hypermail 2.1.8 : Sat Oct 04 2008 - 08:30:00 EDT