| Mirage Source http://miragesource.net/forums/ |
|
| subs and functions http://miragesource.net/forums/viewtopic.php?f=201&t=1331 |
Page 1 of 11 |
| Author: | Ramsey [ Sat Feb 10, 2007 4:12 am ] |
| Post subject: | subs and functions |
how do u know if something should be sub hi() or funtion hi() |
|
| Author: | Spodi [ Sat Feb 10, 2007 4:44 am ] |
| Post subject: | |
Function returns a value, sub does not. In the end, it can do the same thing, it just depends on how you want to do it. Code: Dim I as long i = Multiply(2, 2) Function Multiply(byval a as long, byval b as long) as long Multiply = A * B End Function Code: Dim I as Long
Multiply 2, 2, I Sub Multiply(Byval A as long, byval B as long, byref Return as long) Return = A * B End Sub In the end, I = 2 * 2 both ways. The "ByRef" means that it is "By Reference" instead of "By Value". If you pass as ByRef, and change that value, it changes the variable used in the call. |
|
| Author: | wanai [ Wed May 18, 2022 1:20 pm ] |
| Post subject: | Re: subs and functions |
Reco |
|
| Author: | wanai [ Wed May 18, 2022 1:21 pm ] |
| Post subject: | Re: subs and functions |
126.7 |
|
| Author: | wanai [ Wed May 18, 2022 1:22 pm ] |
| Post subject: | Re: subs and functions |
Repr |
|
| Author: | wanai [ Wed May 18, 2022 1:23 pm ] |
| Post subject: | Re: subs and functions |
Unkn |
|
| Author: | wanai [ Wed May 18, 2022 1:24 pm ] |
| Post subject: | Re: subs and functions |
Gray |
|
| Author: | wanai [ Wed May 18, 2022 1:25 pm ] |
| Post subject: | Re: subs and functions |
Arca |
|
| Author: | wanai [ Wed May 18, 2022 1:27 pm ] |
| Post subject: | Re: subs and functions |
Patt |
|
| Author: | wanai [ Wed May 18, 2022 1:28 pm ] |
| Post subject: | Re: subs and functions |
Dalv |
|
| Author: | wanai [ Wed May 18, 2022 1:31 pm ] |
| Post subject: | Re: subs and functions |
Scot |
|
| Author: | wanai [ Wed May 18, 2022 1:32 pm ] |
| Post subject: | Re: subs and functions |
Nikl |
|
| Author: | wanai [ Wed May 18, 2022 1:33 pm ] |
| Post subject: | Re: subs and functions |
Marc |
|
| Author: | wanai [ Wed May 18, 2022 1:34 pm ] |
| Post subject: | Re: subs and functions |
Lynn |
|
| Author: | wanai [ Wed May 18, 2022 1:35 pm ] |
| Post subject: | Re: subs and functions |
Edou |
|
| Author: | wanai [ Wed May 18, 2022 1:37 pm ] |
| Post subject: | Re: subs and functions |
Beco |
|
| Author: | wanai [ Wed May 18, 2022 1:38 pm ] |
| Post subject: | Re: subs and functions |
Plea |
|
| Author: | wanai [ Wed May 18, 2022 1:39 pm ] |
| Post subject: | Re: subs and functions |
Bodu |
|
| Author: | wanai [ Wed May 18, 2022 1:40 pm ] |
| Post subject: | Re: subs and functions |
Orph |
|
| Author: | wanai [ Wed May 18, 2022 1:41 pm ] |
| Post subject: | Re: subs and functions |
Davi |
|
| Author: | wanai [ Wed May 18, 2022 1:42 pm ] |
| Post subject: | Re: subs and functions |
Leno |
|
| Author: | wanai [ Wed May 18, 2022 1:43 pm ] |
| Post subject: | Re: subs and functions |
Tesc |
|
| Page 1 of 11 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|