daily pastebin goal
12%
SHARE
TWEET

functions.

a guest May 16th, 2018 127 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance,force
  2.  
  3. c:=My_Function(2,2) ; this first call I put both arguments in
  4.  
  5. Msgbox,% c   ; this shows the value of c after it is returned from the function
  6.  
  7. c:=My_Function(2) ;This time I only added one of the arguments, so the function will use the default for the second value
  8.  
  9. Msgbox,% c ; this shows the value of c after it is returned from the function
  10.  
  11. return
  12.  
  13. My_Function(a,b:=10)  ; b is set up so that if you only pass one argument, b will default to 10
  14.     {
  15.         return a + b
  16.     }
  17.  
  18. *^esc::ExitApp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top