[TUT]How to write your own function[/TUT] - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19) +---- Thread: [TUT]How to write your own function[/TUT] (/showthread.php?tid=17423) Pages:
1
2
|
[TUT]How to write your own function[/TUT] - Modestep - 03-27-2011 A function is something you can write and put in your code. You can use it as many times later on in the code without having to write it again and again. The difference between a Sub and a function is that a function returns something.
Add 2 numbersIt's being used in crypters for the encrypting/decrypting alot. Oke lets start Code: Function Add(ByVal intNumber1 As Integer, ByVal intNumber2 As Integer) As Integer How we use this: Code: MessageBox.Show(Add(TextBox1.Text, TextBox2.Text)) Even and Odd numbers Code: Function EvenOrOdd(ByVal intNumber As Integer) As Boolean I hope this was a good little tut, if there is interest i will make another to check if a number is a prime number, perfect number etc.. And i will cover a Sub in the next tut and more advanced functions
RE: [TUT]How to write your own function[/TUT] - Resistance - 03-27-2011 Very well made tutorial. Formatting isn't so bad but very understandable. I read through the whole thing and it helped me out a bit. Totally bookmarked. Thanks a lot. RE: [TUT]How to write your own function[/TUT] - Nick - 03-27-2011 This is a really nice and thorow tutorial. Great job man! RE: [TUT]How to write your own function[/TUT] - Modestep - 03-27-2011 (03-27-2011, 08:56 AM)L3g1tWa5te Wrote: Very well made tutorial. Formatting isn't so bad but very understandable. I read through the whole thing and it helped me out a bit. Totally bookmarked. Thanks a lot.Thank you, it's my first programming tutorial, more to come! RE: [TUT]How to write your own function[/TUT] - h4yr0 - 03-28-2011 You should explain byref,byval and optional ? RE: [TUT]How to write your own function[/TUT] - Modestep - 03-29-2011 (03-28-2011, 02:38 PM)h4yr0 Wrote: You should explain byref,byval and optional ?Oke i will do it, but first i am gonna think how to explain it, its not easy to explain ;p in text. RE: [TUT]How to write your own function[/TUT] - thanasis2028 - 03-29-2011 (03-28-2011, 02:38 PM)h4yr0 Wrote: You should explain byref,byval and optional ?And overloading too, if you want to make a complete tutorial on functions. RE: [TUT]How to write your own function[/TUT] - h4yr0 - 03-30-2011 yes man , I forget that one ) RE: [TUT]How to write your own function[/TUT] - Pyratepig - 04-02-2011 Great tutorial for beginners. This should encourage them to make their own functions instead of looking for premade source codes around the internet. RE: [TUT]How to write your own function[/TUT] - Anarchy - 04-02-2011 Great tut i love it keep it up. |