Computing.Net > Forums > Programming > Visual Basic POWER

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Visual Basic POWER

Reply to Message Icon

Name: Denise
Date: July 22, 2002 at 10:11:15 Pacific
Comment:

I want to do a simple power function in a program for example

x to the power or y

When I use POWER(x,y) I get an error that POWER is not defined. Do you know if I need to have something else set to use this function?? I am using VB 6!! Please HELP!

THANKS!



Sponsored Link
Ads by Google

Response Number 1
Name: Jeff J
Date: July 22, 2002 at 11:05:43 Pacific
Reply:

You might be thinking of SQL or something, or maybe pow in C/C++. VB does not have a separate function for power, it overloads the ^ operator...

XtoPowerOfY = x ^ y

Cheers


0

Response Number 2
Name: Hayley
Date: July 24, 2002 at 04:23:49 Pacific
Reply:

pow(x,y) usually works for me
try looking it up in the help (press f1 in the program)


0

Response Number 3
Name: Defrule
Date: August 14, 2002 at 10:41:18 Pacific
Reply:

Public Function Power(X As long, Y As Long)
Power = X ^ Y
End Function

You have either forgot to create the funcion or maybe you have Privately declared it somewhere else. If you want to make that functon available to the entire program then use PUBLIC Function..... in a Module


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Visual Basic POWER

JAVA is superior to Visual Basic www.computing.net/answers/programming/java-is-superior-to-visual-basic/1927.html

Visual basic script or #net www.computing.net/answers/programming/visual-basic-script-or-net/15785.html

List Databses is Visual Basic 6 www.computing.net/answers/programming/list-databses-is-visual-basic-6/15612.html