Click here to Skip to main content
16,011,754 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: including line/scatter chart in VB.net Pin
Thomas Stockwell6-Oct-08 6:14
professionalThomas Stockwell6-Oct-08 6:14 
AnswerRe: including line/scatter chart in VB.net Pin
Dave Kreskowiak6-Oct-08 6:20
mveDave Kreskowiak6-Oct-08 6:20 
GeneralRe: including line/scatter chart in VB.net Pin
Amanjot6-Oct-08 16:29
Amanjot6-Oct-08 16:29 
GeneralRe: including line/scatter chart in VB.net Pin
Dave Kreskowiak7-Oct-08 2:01
mveDave Kreskowiak7-Oct-08 2:01 
Questionfilestream not working properly Pin
kjdion5-Oct-08 10:16
kjdion5-Oct-08 10:16 
AnswerRe: filestream not working properly Pin
jzonthemtn5-Oct-08 11:40
jzonthemtn5-Oct-08 11:40 
AnswerRe: filestream not working properly Pin
Guffa5-Oct-08 22:55
Guffa5-Oct-08 22:55 
Questionneed help on FUnctions Pin
ay3ssah5-Oct-08 5:59
ay3ssah5-Oct-08 5:59 
hi! i'm new to vb .net..i want to calculate a power, i want to do it in a function..i'm having a hard time with arguments and parameters as well as with the return value.

please help! i have 2 text boxes for accepting inputs for base and exponent.

Public Class Power

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim base, exp As Integer

base = Val(text1.Text)
exp = Val(text2.Text)

MessageBox.Show("Power: " & Power(base, exp)) //how about this??
End Sub

Function Power(ByVal x As Integer, ByVal y As Integer)
Dim pow, i As Integer

Select Case y
Case 1
MessageBox.Show(x & " raised to " & y & " is 1")

Case 0
MessageBox.Show(x & " raised to " & y & " is 0")
End Select

For i = 2 To y
Return pow = pow * x //is this correct??
i += 1
Next



Return ??what/how??
End Function

End Class
AnswerRe: need help on FUnctions Pin
AlexeiXX35-Oct-08 7:22
AlexeiXX35-Oct-08 7:22 
GeneralRe: need help on FUnctions Pin
ay3ssah5-Oct-08 18:58
ay3ssah5-Oct-08 18:58 
AnswerRe: need help on FUnctions Pin
Guffa5-Oct-08 7:31
Guffa5-Oct-08 7:31 
GeneralRe: need help on FUnctions Pin
ay3ssah5-Oct-08 18:56
ay3ssah5-Oct-08 18:56 
GeneralRe: need help on FUnctions Pin
AlexeiXX35-Oct-08 19:05
AlexeiXX35-Oct-08 19:05 
AnswerRe: need help on FUnctions Pin
Anoop Brijmohun6-Oct-08 0:53
Anoop Brijmohun6-Oct-08 0:53 
GeneralRe: need help on FUnctions Pin
ay3ssah6-Oct-08 2:51
ay3ssah6-Oct-08 2:51 
QuestionWriting a catch error handing Pin
zo9005-Oct-08 2:06
zo9005-Oct-08 2:06 
QuestionRe: Writing a catch error handing Pin
jzonthemtn5-Oct-08 7:42
jzonthemtn5-Oct-08 7:42 
AnswerRe: Writing a catch error handing Pin
zo9005-Oct-08 8:19
zo9005-Oct-08 8:19 
GeneralRe: Writing a catch error handing Pin
jzonthemtn5-Oct-08 8:30
jzonthemtn5-Oct-08 8:30 
GeneralRe: Writing a catch error handing Pin
zo9005-Oct-08 8:40
zo9005-Oct-08 8:40 
QuestionHow do I show an uncommon image format? Pin
Sonhospa4-Oct-08 0:56
Sonhospa4-Oct-08 0:56 
AnswerRe: How do I show an uncommon image format? Pin
Dave Kreskowiak4-Oct-08 5:25
mveDave Kreskowiak4-Oct-08 5:25 
GeneralRe: How do I show an uncommon image format? Pin
Sonhospa4-Oct-08 8:42
Sonhospa4-Oct-08 8:42 
GeneralRe: How do I show an uncommon image format? Pin
Dave Kreskowiak4-Oct-08 13:18
mveDave Kreskowiak4-Oct-08 13:18 
QuestionVB.NET comboBox help !! Pin
Saam_cse4-Oct-08 0:55
Saam_cse4-Oct-08 0:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.