MessageBox.Show("It's also a good idea to try doing things on your own without the tutorials. I've learned alot as well without watching the tutorials", "My Comment",MessageBoxButtons.OK)
@TheRoxas13th
11 жыл бұрын
Yeah, it work exactly the same without the ByVal. Someone explain this to me =="
@OriginalTrousers
11 жыл бұрын
Why use ByVal at all? Why not just do private function subtract(num1 as double, num2 as double) as double return num1 - num2 end function
@rwbangsil
8 жыл бұрын
it is a bad example of byval, coz when i tried to change it to byref, it gave the same result.
@etherealvox2010
8 жыл бұрын
assume variable "input"=10 assume a function named "newFunction" that increments the argument 1) using myVar i.e. newFunction(myVar x as integer) bla bla --> x +=1 newFunction(input) the result will be 11 console.writeline(input) the result will pe 10 2) using myRef i.e. newFunction(myRef x as integer) bla bla --> x +=1 newFunction(input) the result will be 11 console.writeline(input) the result will pe 11
@MrEpicSpace
9 жыл бұрын
ByVal isn't even needed in VB 2013, and I have done outcome comparisons and nothing changes. It's useless, and Microsoft kept ByVal there. It must change something that we know nothing about. Or maybe it really doesn't do anything Edit:It's official: ByVal is rendered useless in Visual Basic on Visual Studio 2013
@SCIFIDW
9 жыл бұрын
***** Sorry if this is a stupid question but I'm very new to programming. So you mean we can remove ByVal and it would work without replacing it with something?
@MrEpicSpace
9 жыл бұрын
SCIFIDW Yes. ByVal is useless in the new VB
@xXBR4D3NXx
11 жыл бұрын
ByVal - " Specifies that an argument is passed in such a way that the called procedure or property cannot change the value of a variable underlying the argument in the calling code." - MSDN
@ThatsoCliche
11 жыл бұрын
Public Class Form1 Private Sub BtnSubtract_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSubtract.Click Dim Answer As Double = Subtract(TextBox1.Text, TextBox2.Text) MessageBox.Show(Answer) End Sub
@rajamohdafiq480
11 жыл бұрын
this is tutorial so that someone like me can learn the basic thing that maybe can be use in big thing.
@ThatsoCliche
11 жыл бұрын
Private Function Divide(ByVal num1 As Double, ByVal num2 As Double) Return num1 / num2 End Function Private Function Multiply(ByVal num1 As Double, ByVal num2 As Double) Return num1 * num2 End Function Private Function Subtract(ByVal num1 As Double, ByVal num2 As Double) Return num1 - num2 End Function End Class
@xiaozhang4066
11 жыл бұрын
I still don't understand what ByVal does. Does is dim the variables outside the function? Cause you didn't dim num1 and num2 in sub but function. Also, the perimeter (TextBox1.text, TextBox2.text) confuses me allot.
@alphaahtube
12 жыл бұрын
He means that, you can pass arguments of any type even if it's different than the function's type. Function's type is the type of data that it returns, argument's type is the type of argument that is passed to the function.
@Raw2v07
12 жыл бұрын
@fillecool2 Think its My.computer.audio.Xxxxxxxxxx Cant remember the rest soz intellisense will know though
@Cliffardo
6 жыл бұрын
Stranger error, but its an annoying one I did this perfectly fine and I had no errors it works. I re open the project the code still works however some of it is underlined in red? EDIT: Okay this is happening on like everything now, even on things like Console.ReadLine it keeps underlining them in red when its fine and it is working OK I don't know what has happened but it is extremely annoying. I need to do screenshots for evidence but I can't with this there and there is nothing wrong with the code. The thing the error keeps saying is "Option Strict On disallows implicit conversions from String to Integer" This error has never come up for me before until the past hour or so I don't know if I have turned on a setting somewhere or what
@alphaahtube
12 жыл бұрын
That depends on what the function does. A function could need a string to output, or to manipulate, but it would return an integer. An example is a function that gets the length of a string, you would pass a string as an argument, but it would return an integer.
@2pimpinout
12 жыл бұрын
@techstuffs27 double click on "My Project" on the side, and a Windows will open with an Application tab selected. You will find the icon selection.
@sbasalan
11 жыл бұрын
like a couple numbers of your video style.. You made the some showing same way to show..
@floreloriz4667
8 жыл бұрын
I didn't know so simple calculator can be made. TY
@alphaahtube
12 жыл бұрын
C++.
@longsophy1130
8 жыл бұрын
Could anybody tell me if textbox.text return number value or string? if it return a string, why we can pass this string to the arguments of double datatype in subtractNumbers function? sorry my English isn't good. i'm learning it.
@elmik1351
2 жыл бұрын
Sorry for the 5 year late reply, Textbox.text returns any value depending on the variable you want to display in the textbox. So, if you want to display a string in the textbox, thats fine. Works with an Integer as well as doubles.
@bomer890
13 жыл бұрын
10th to caomment... "where beginner javascript tutorial?"
@brandondupuis8243
9 жыл бұрын
Good tutorial man! Nice job :)
@pb695
10 жыл бұрын
what if i want characters e.g "a,g,h," instead of numbers as the variable?
Пікірлер: 37