Advertisement
Guest User

functions.

a guest
May 16th, 2018
168
0
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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement