FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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.
Related topics
FreeBSD 6.0 is up and running!
Need help - Corel photopaint 6.0 Missing Menues (resolved)
Visual basic 6.0 help me with saving code please
Need help with logger script. (half done)
Norton Internet Security 2005 & AIM 6.0
Help With Sony Vegas Please
how about security of visual basic 6.0??
VB Help for those who need small pointers in Visual Basic
DataLife Engine v.6.0 Final - Great Script for your site
VMWare 6.0
Adobe Photoshop CS2 vs CS3
(AYUDA)actualizaciar drupal 6.0
Debian 6.0 soon released
blackberry o.s 5 to 6.0
Reply to topic    Frihost Forum Index -> Scripting -> Others

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