Raised This Month: $ Target: $400
 0% 

custom functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-20-2019 , 14:46   Re: custom functions
Reply With Quote #1

Quote:
Originally Posted by LearninG View Post
what type of values can i add into "()"
Any.

Quote:
Originally Posted by LearninG View Post
how to use them in function ?
The way it's meant to be used.

Quote:
Originally Posted by LearninG View Post
does this example works ?
PHP Code:
public some_func(variable1 variable2)
{
    
variable1 random_num(5,15)
    
variable2 variable1 10
    
    
if (variable1 10)
    {
        return 
variable2
    
}

If you mean compile, then it should, but I don't know what way you're expecting it to work, it takes 2 values, then assigns a random number in-between 5 and 15 to the first variable, then increases then second variable by 10, then it checks whether variable1 (the random number) is smaller than 10 and returns variable 2 if true.
__________________
edon1337 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode