FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

VisualBasic 6.0 Help

 


rohan2kool
1. How can I make functions in VB 6.0(not .NET) that will return an integer value and will also take in two string parameters.

2. What is the difference between a subroutine and a function.

3. How do I break loops in VB.

4. How can I determine the length of a string.

thanks a lot. Please note that it is applicable to VB 6.0 only and not VB .net. That's because the client i'm making it for wants the VB 6.0 source code and has refrained from .net versions.
AftershockVibe
I haven't done any VB 6.0 for years but I think I can remember most of these. You'll soon find out if I'm wrong and I'm sure others will correct me if necessary anyway!

1. How can I make functions in VB 6.0(not .NET) that will return an integer value and will also take in two string parameters.

Code:
private function MyFunction(param1 as string, param2 as string) as integer


2. What is the difference between a subroutine and a function.

Functions return a value, so you can set something to be equal to them. Subroutines do not, they just execute then return to where you called them.

3. How do I break loops in VB.

There is probably a "exit" or "escape" command of some sort but it's considered bad form to use them. You really want something like this:

Code:
Error = false

while((i < 999) AND (Error = false)) do

<whatever>
if(<ErrorCondition>) then

Error = true

end if


and that will get you out

4. How can I determine the length of a string.

Code:
len(string)
rohan2kool
5. How do i actually return a variable in a function???

If i use:

Code:

return somevariable 'Or
return 0


it gives me an error.

thanks 4 the help
AftershockVibe
Code:
MyFunctionsName() = x
Return


Yes it's an odd way to do it, but that's VB for you.
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.