// First we declare any functions and variables that we're going to use // They can be declared anywhere in the script // as long as they're declared before we use them // Note we don't need to declare the 'built-in' system functions like HubInit() Func1(); Func2(float val); string sMessage; // The first function is usually HubInit() // This is always called when FreeWay powers up HubInit() { // print a welcome message to the debug Telnet interface DebugPrint("Welcome to the FreeWay demo script! \n\r"); } // Now we'll define a function that we'll call from the FreeWay's // built-in Web Page Func1() { // Print out a debug message DebugPrint("Func1 has been called \n\r"); } // This function demonstrates how to pass a numeric value to the function // the value is converted into text and printed out Func2(float val) { // build the message sMessage = "You passed value " + format(val,1,0) + " to Func2 \n\r"; // print out the message DebugPrint(sMessage); }