The syntax for function definitions are like the following:
Access-modifier function function-name(var-name:type):return-type{}
Here access-modifier may be public, private for the function function-name with argument var-name of type. This function will return return-type.
Like objects, HaXe functions are typed. Their type depends on two things:
• The arguments taken by the function.
• The return type of the function.
For example, we have the following function,
public function prime(even : String, odd : String) : Int
Here the function prime has arguments even and odd of type string. This returns an Int type. We can denote this as:
String->String->Int
We can even take a function as an argument to our function. And also can return a function. let’s take a look at the following function:
public function prime(even : String, odd : String->Int) : Int
We can write this like:
String->(String->Int)->Int.
Ok, now we will show a function which accepts the above arguments but returns a function with two arguments of type Int and returns a String. So, the function is like:
function m2(arg1 : String, arg2 : String->Int) : Int->Int->String;
Now let’s see how we will write that:
String->(String->Int)->(Int->Int->String)
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide
List of my works:
Technical Support:
If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.
Wordpress Plugins:
If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.
Wordpress Plugins:
- Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
- Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.
Opencart Extensions:
- Product Based Quantity Wise Shipping: Find it here.
- OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
- Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
- Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
- Custom Field Product - add unlimited custom fields to the product form: Find it here.
- Formcaptcha - add captcha on the register page: Find it here.
No comments:
Post a Comment