I wish to nest Function2 inside Function1 so that Function2 can be 
called multiple times to perform slightlt different calculations 
within Function1.

The syntax checker highlights the line with Function2 and 
displays "Error 32. Syntax Error, probably missing semicolon at the 
end of the previous line".

If I insert } prior to the Function2 line the compile error goes.

Is there a way around this?  Or, do I have to rethink my approach.

A section of the code follows.

Thanks

Graham

pPrice = ParamField("Price field",-1);
pMAType = ParamList("MA Type", "1 - DEMA|2 - EMA|3 - Linear 
Regression|4 - SMA|5 - TEMA|6 - Wilders|7 - WMA", 4 - 1);
        // "defaultval" is Zero based, so need to subtract 1 to match 
list
pMaxPerMA = Param("Max MA Periods", 52, 26, 104, 1, 10);

function Function1(iPrice, iMAType, iMaxPerMA)
{
        xMAType = StrToNum( StrLeft( iMAType, 1 ) );

        function Function2(iiPrice, iiMAType, iiMAPer)
        {
                switch (iiMAType)
                {
                        case 1:
                        xaMA = DEMA(iiPrice, iiMAPer);
                        break;
                }
        }
}

Reply via email to