Raised This Month: $ Target: $400
 0% 

Tag Mismatch Mayhem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Prometheus.
Member
Join Date: Sep 2004
Old 10-20-2004 , 11:02   Tag Mismatch Mayhem
Reply With Quote #1

Typical of me, i'm knock for my "TMM"'s.

Ok let's see about 40 tag mismatch errors in 1000 lines of code. I know it's good practice to split your plugins into multiple files, but I realy can't work like that.

What I want to know is, what realy causes this error, as I don't want to have to post my code in here as it took me a while and I don't plan for an un-compiled release.
.Prometheus. is offline
Send a message via AIM to .Prometheus. Send a message via MSN to .Prometheus.
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 10-20-2004 , 11:07  
Reply With Quote #2

I believe that tag mismatches happen when you give a function parameters of the wrong type.
__________________
twistedeuphoria is offline
.Prometheus.
Member
Join Date: Sep 2004
Old 10-20-2004 , 11:09  
Reply With Quote #3

Everyone seems to confuse this...That's argument mismatch I think.
.Prometheus. is offline
Send a message via AIM to .Prometheus. Send a message via MSN to .Prometheus.
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 10-20-2004 , 11:15  
Reply With Quote #4

Oh, I thought arg mismatch is when you pass it the wrong number of arguments.
__________________
twistedeuphoria is offline
.Prometheus.
Member
Join Date: Sep 2004
Old 10-20-2004 , 11:19  
Reply With Quote #5

Nope.
.Prometheus. is offline
Send a message via AIM to .Prometheus. Send a message via MSN to .Prometheus.
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 10-20-2004 , 11:59  
Reply With Quote #6

Here is what causes a tag mismatch exactly:

Code:
new Float:var1 = 5.0; new var2 = 6; var2 = var1;    // TAG MISMATCH!!!

Let's examine this code...
Line1: var1 has the Float tag. Numbers in the form of x.y have the Float tag too. So this assignment works.
Line2: var2 has no tag. Numbers in the form of x have no tag too. This assignment works too.
Line3: var2 has no tag, but var1 has Float tag. This causes a tag mismatch.

Basically, tag mismatches are errors. That is, if you assign a float to an int like this, you get a garbage result. Use the floatround() (or float() to do it the other way round) function instead of simply assigning.
__________________
hello, i am pm
PM is offline
.Prometheus.
Member
Join Date: Sep 2004
Old 10-20-2004 , 12:13  
Reply With Quote #7

Well the problem is kinda focused around every time I do a mysql command.

Ok let me get an exaaaaamppppleeeee:

format(query,255,"SELECT job_name,job_pay FROM jobs WHERE jobid='%s'",job_id_res);

query_store = dbi_query(mysql,query);

dbi_nextrow(query_store)

dbi_field(query_store, 1, job_name_res, 31);

dbi_field(query_store, 2, job_pay_res, 31);

Every time I use a query_store thingy it gives me an error. and all I do is new query_store in each public thingy()
.Prometheus. is offline
Send a message via AIM to .Prometheus. Send a message via MSN to .Prometheus.
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode