 |
 |

05-15-2003, 10:06 PM
|
|
Newcomer
|
|
Join Date: May 2003
Posts: 6
|
|
New to VB....probably a stupid question
|
Hey....this is probably a really stupid question but i was wandering if anyone could tell me what the message "Type Mismatch" means ... and why it highlights this line when it gives me the error...
g_dPriceArray(iCounter) = Field(sLine, ",", 2)
please....if someone could help that would be great!
|
|

05-15-2003, 10:18 PM
|
 |
Centurion
|
|
Join Date: Apr 2003
Location: Ontario, Canada
Posts: 136
|
|
It means you declared the variable wrong.. ie. its an integer and you declared it as a string. i cant tell you precisely which variable you declred wrong without seeing where you declared your variables.. but thats where you went wrong.
edit: Hope this helps 
|
__________________
(Please correct me if I'm wrong.. I'm dumb)
|

05-15-2003, 10:21 PM
|
|
Newcomer
|
|
Join Date: May 2003
Posts: 6
|
|
Hey Vision, thanks, here are my declarations....i don't understand what i have done wrong...
'Global Declarations
Global Const g_iUpperIndex As Integer = 100
'Declare global arrays
Public g_sTitleArray(g_iUpperIndex) As String
Public g_dPriceArray(g_iUpperIndex) As Double
Public g_sCategoryArray(g_iUpperIndex) As String
Public g_dQuantityArray(g_iUpperIndex) As Double
|
|

05-15-2003, 10:30 PM
|
 |
Centurion
|
|
Join Date: Apr 2003
Location: Ontario, Canada
Posts: 136
|
|
|
im sorry.. i dont see anything noticably wrong with that. im also a newbie so im unfamiliar with the use of 'Public' as a declaration and Global Const. When I paste those into vb i get like, half a dozen different errors and couldnt figure it out.. someone else will have to help you.. sorry again
another possibility is sLine and iCounter could be declared wrong. you didnt post where you declared them... other than that, i have no more ideas
|
__________________
(Please correct me if I'm wrong.. I'm dumb)
|

05-15-2003, 10:32 PM
|
|
Newcomer
|
|
Join Date: May 2003
Posts: 6
|
|
|
No worries ViSiOn...Thanks for ur help anyways! I'm just soooooooo lost when it comes to programming hehe
|
|

05-15-2003, 10:44 PM
|
 |
Junior Contributor
|
|
Join Date: Feb 2003
Location: Philippines
Posts: 336
|
|
Quote: Originally Posted by bellaLANA No worries ViSiOn...Thanks for ur help anyways! I'm just soooooooo lost when it comes to programming hehe
Your g_dPriceArray(iCounter) expects a Double type value and your Field(sLine, ",", 2) is not returning that type. That's why you get type mismatch error. What are you expecting to get from Field(sLine, ",",2) by the way? 
|
__________________
"Everything should be made as simple as possible, but not simpler."
- Albert Einstein
|

05-15-2003, 10:56 PM
|
|
Newcomer
|
|
Join Date: May 2003
Posts: 6
|
|
|

05-16-2003, 12:21 AM
|
 |
Village VB Idiot
* Expert *
|
|
Join Date: Jan 2003
Location: Idaho
Posts: 1,850
|
|
Where is the Field function declared? Is it located in a Module in your project? I couldn't find it in my object browser. 
|
|

05-16-2003, 09:56 PM
|
|
Newcomer
|
|
Join Date: May 2003
Posts: 6
|
|
|
the declaration for the Field function is in another module in the project...
|
|

05-16-2003, 10:05 PM
|
 |
Junior Contributor
|
|
Join Date: Feb 2003
Location: Philippines
Posts: 336
|
|
Quote: Originally Posted by bellaLANA the declaration for the Field function is in another module in the project...
Have you checked also what type it will return? It is supposed to return Double type inorder for you not get the type mismatch error. If it is declared with diffirent return type, then either you need to change that or the type of your Public g_dPriceArray(g_iUpperIndex) 
|
__________________
"Everything should be made as simple as possible, but not simpler."
- Albert Einstein
|

05-16-2003, 10:24 PM
|
|
Newcomer
|
|
Join Date: May 2003
Posts: 6
|
|
|
ahhhhhhhhh this is really shi**ing me! lol
the Public g_dPriceArray(g_iUpperIndex) as Double -- is how it is declared in the Field sub
then in another module it is..
Public g_dPriceArray(iCounter) = Field....bla bla
i am sooooooooooooooooo lost!
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|