| | |
errors in my file but not sure whats wrong file attatched
![]() |
•
•
Join Date: Jul 2005
Posts: 19
Reputation:
Solved Threads: 0
hi all have spent a lot of time recently trying to get the attatched programe to run.
decided to start from scratch,went through the tutorial for vb6 on main page of functionx , tried a few examples and all are ok,except where i had put in code incorrectly.
but this example has got me beat, i get error 13 if i try to run programe.
using debug it points me to a a line of code ,that as far as i can see is exactly the same as code in tutorial.
i put the code in by pasting original code from tutorial to clipboard, and into vb project, but cannot quite find see whats incorrect with my project??
thank you
decided to start from scratch,went through the tutorial for vb6 on main page of functionx , tried a few examples and all are ok,except where i had put in code incorrectly.
but this example has got me beat, i get error 13 if i try to run programe.
using debug it points me to a a line of code ,that as far as i can see is exactly the same as code in tutorial.
i put the code in by pasting original code from tutorial to clipboard, and into vb project, but cannot quite find see whats incorrect with my project??
thank you
The problem is that you have your textboxes initialized to strings, which cannot be converted into doubles, so VB complains. The quickest way to make VB ignore this is to add the line:
at the top of the sub. This tells VB to continue on to the next line when an error arises. It certainly is not the best way to handle errors, but until you decide exactly what you want to do, it will work. So, applying it to your program, it would look like this:
If you need more help on Error Handling, let me know, and I'll try to explain to you how it works. It's not hard.
Hope this helps.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
On Error Resume Next
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub optaddition_Click() On Error Resume Next Dim dblNumber1 As Double Dim dblNumber2 As Double Dim dblResult As Double dblNumber1 = CDbl(txtnumber1.Text) dblNumber2 = CDbl(txtnumber2.Text) dblResult = dblNumber1 + dblNumber2 txtresult.Text = dblResult End Sub
If you need more help on Error Handling, let me know, and I'll try to explain to you how it works. It's not hard.
Hope this helps.
.:Computer Science is a race between mankind trying to build bigger, faster computer programs, and the universe trying to build bigger, faster idiots... So far the universe is winning:.
•
•
Join Date: Jul 2005
Posts: 19
Reputation:
Solved Threads: 0
thanks lalo in the tutorial it just gives info on the names of the controls such as name frm operations/caption is operations
name optaddition/caption addition
there are three boxes on the left hand side of form shown in the tutorial labeled or marked as below
first number, second number,result with names txtnumber1 txtnumber2 txtresult,
i assumed i needed to add three textboxes , or should i have used a differant control rather than a textbox ????
the code is provided in the tutorial , so know there is an error in the way i have created my form, i can see what you mean (text is text and not a number) what i am unsure of is what i change in my layout/controls of my form for the code to work as it was written.
thank you for your help i need to do a bit more reading practise on vb
name optaddition/caption addition
there are three boxes on the left hand side of form shown in the tutorial labeled or marked as below
first number, second number,result with names txtnumber1 txtnumber2 txtresult,
i assumed i needed to add three textboxes , or should i have used a differant control rather than a textbox ????
the code is provided in the tutorial , so know there is an error in the way i have created my form, i can see what you mean (text is text and not a number) what i am unsure of is what i change in my layout/controls of my form for the code to work as it was written.
thank you for your help i need to do a bit more reading practise on vb
![]() |
Similar Threads
- Can't delete a .jpg file. Help. (Windows NT / 2000 / XP)
- linksys router problem (Networking Hardware Configuration)
- Whats wrong with my computer??? (Viruses, Spyware and other Nasties)
- .NETframework (C++)
- Help PC keeps shutting down (Viruses, Spyware and other Nasties)
- Whats wrong with this class??? (C++)
- Missing status bar in new IE window (Web Browsers)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Sumbit 2GB+ files to Windows Spooler
- Next Thread: Setting an object defaults.
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





