Computer Science Canada [Tutorial] Functions |
Author: | MysticAngel [ Tue May 20, 2003 11:01 pm ] | ||
Post subject: | [Tutorial] Functions | ||
VB is really easy compared to turing. Cuz in VB all u have to do is stick in the buttons and all that stuff and just write the code for all those stuff. first thing you got to do for every progam is write Option Explicit Then you carry on with your code It's worth making very clear that a function always returns a single value and never more. Although a function's argument list can sometimes contain five or more arguments, a function never returns more than one value while procedures can have more than one ouput or none. eg.
In Any subprograms it is necessary and important that when you call the functions or procedures the parameters should match exactly the way you declared them. else you would get an error. hope this is good enough. |
Author: | Tony [ Wed May 21, 2003 9:22 am ] |
Post subject: | |
thx for the explanation on functions, I'm glad people finally post stuff on languages other then turing +15Bits Also could you explain what Option Explicit does? |
Author: | MysticAngel [ Wed May 21, 2003 10:44 am ] |
Post subject: | |
Option Explicit explicitly declares all variables using the Dim, Private, Public, or ReDim statements. If you attempt to use an undeclared variable name, an error occurs at compile time. If you don't use the Option Explicit statement, all undeclared variables are of Object type. Option Explicit should be declared at the very beginning even before you delcare any global variabels (if any) |
Author: | Tony [ Wed May 21, 2003 2:16 pm ] |
Post subject: | |
thx Cuz I keep on getting those errors and then have to look for typoes in my variable names |
Author: | MysticAngel [ Thu May 22, 2003 1:11 pm ] |
Post subject: | |
yeah, that used to happen to me most of the time,so i would go through the entire code and see where i have gone wrong and i would realize that i hadnt written the option explicit. |