Results 1 to 4 of 4
  1.    #1  
    How, and where, do I create a global static function?

    ex.

    F1(Var1, Var2)
    {
    return Var1 + Var2;
    }
  2. #2  
    I create a lib folder under app and put in .jsjsjs $files$.

    Just define as:
    function F1()
    {
    Blah;
    }

    Add to sources. Callable anywhere.
  3.    #3  
    I added app/assistants/lib/global.jsjsjs $and$ $added$ $it$ $to$ $sources$.$json$

    In there I have a function CalcValue that returns a value.

    Calling the function must error out as the processing fails.
  4. #4  
    Quote Originally Posted by geiger View Post
    I added app/assistants/lib/global.jsjsjs $and$ $added$ $it$ $to$ $sources$.$json$

    In there I have a function CalcValue that returns a value.

    Calling the function must error out as the processing fails.
    I'm not understanding what you are saying here. You want the call to error if processing fails?

    I don't put mine under assistants, I put it in root of app.

    I'll give you my example:
    I have helpers.jsjsjs $under$ $app$/$lib$ $with$ $this$ $function$ ($among$ $others$):
    Code:
    function randInt(max){
    	return Math.floor(Math.random()*(max+1));
    }
    Added this to sources.json:
    Code:
        {"source": "app\/lib\/helpers.jsjsjs&$quot$;},
    Calling randInt(10) returns a random number 0-10 any where in my app.
    Your Pre wants Word Whirl from the App Catalog.

    It told me.

Posting Permissions