Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 14th, 2007, 07:12 PM
Registered User
 
Join Date: Mar 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default runtime error '13' type mismatch

This is my first error of this type I am new to VB6 and trying to get a racecar program for the pinewood derby to work.
The problem is in this line:
RaceMode = GetSetting("DownHillDash", "Main", "TimerType")


End With
    lblLane1Name.Caption = GetSetting("DownHillDash", "Main", "Lane1Name")
    lblLane2Name.Caption = GetSetting("DownHillDash", "Main", "Lane2Name")
    lblLane3Name.Caption = GetSetting("DownHillDash", "Main", "Lane3Name")
    lblLane4Name.Caption = GetSetting("DownHillDash", "Main", "Lane4Name")
RaceMode = GetSetting("DownHillDash", "Main", "TimerType")
    ReadyToRace = False

Any help greatly appreciated.
Mike
 
Old March 14th, 2007, 08:09 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Is RaceMode an object or a type? It seems that GetSetting is a function that returns a string, am I correct??

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 14th, 2007, 08:55 PM
Registered User
 
Join Date: Mar 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I believe that it is a type. and returns a string. When I hilight it it shows: timertype=empty
Thanks

 
Old March 15th, 2007, 05:28 PM
Registered User
 
Join Date: Mar 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found race mode and it is an integer:
Public RaceMode As Integer

Thanks,

Mike

 
Old March 15th, 2007, 05:39 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

But getsetting returns a string? Have you tried casting the return value of GetSetting to an integer? Is the function returning a numerical value that can even be cast?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old March 15th, 2007, 10:28 PM
Registered User
 
Join Date: Mar 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It seems that This fixed it:
RaceMode = GetSetting("DownHillDash.mdb", "Main", "TimerType", "0")
I found a help file that said getsetting must have this type order to work.
My new problem is:[Microsoft][ODBC MicrosoftAccess Driver]Could not find the file unknown
 Main.RaceObject.Initialize (cmbGroupList.ItemData(cmbGroupList.ListIndex))

Any help appreciated.






Similar Threads
Thread Thread Starter Forum Replies Last Post
getting runtime error 13: type mismatch rita9 Beginning VB 6 2 March 14th, 2008 04:36 AM
hi i got runtime error 13 Type Mismatch error sriharsha345 Access VBA 2 February 21st, 2008 09:30 AM
Why am I getting Runtime Error 13: Type Mismatch? dan_thorman Excel VBA 1 January 24th, 2007 02:06 PM
Runtime Error 13: Type Mismatch in VB6 migzheart Access VBA 1 December 28th, 2005 07:54 AM
Error 13 Type Mismatch lguzman Access VBA 2 January 6th, 2005 10:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.