Raised This Month: $ Target: $400
 0% 

Compiler Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-02-2012 , 16:03   Compiler Help
Reply With Quote #1

So i have never run across this before. I tried to compile the .sma and normally when its got errors it will tell you. But for some reason it just sits on the compile screen and never advances. What would cause this?

Like i said I have never seen it before. I added in normal SQLx and then this started happening. Hopefully some one knows.

Files below
Attached Files
File Type: sma Get Plugin or Get Source (BattlefieldMod-XP.sma - 584 views - 63.4 KB)
File Type: inc bfmod.inc (419 Bytes, 112 views)
File Type: inc colorchat.inc (5.9 KB, 112 views)
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2012 , 16:14   Re: Compiler Help
Reply With Quote #2

Code:
..\compile.sma(2195) : error 075: input line too long (after substitutions)
Also, you can't use "#pragma semicolon 1" because colorchat.inc does not adhere to that directive.
__________________

Last edited by fysiks; 01-02-2012 at 16:14.
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-02-2012 , 16:22   Re: Compiler Help
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Code:
..\compile.sma(2195) : error 075: input line too long (after substitutions)
Also, you can't use "#pragma semicolon 1" because colorchat.inc does not adhere to that directive.
I added the semi colons to the colorchat inc. if that's what your saying.

How did you get yours to give you that error mine just sits on the black screen sitting and waiting to compile (or does it just take an extra long time)
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2012 , 16:33   Re: Compiler Help
Reply With Quote #4

Quote:
Originally Posted by Doc-Holiday View Post
I added the semi colons to the colorchat inc. if that's what your saying.

How did you get yours to give you that error mine just sits on the black screen sitting and waiting to compile (or does it just take an extra long time)
It's this thing I call "debugging". EDIT: I guess I should elaborate here. I commented every line starting at line 283 to the end of the file.

Also, it's not a good idea to change a well published include file if the change is not negligible (in this case it is certainly not negligible). Unless you never plan on releasing your completed plugin to the public. Just remove the semicolon pragma and all will be good.
__________________

Last edited by fysiks; 01-02-2012 at 16:35.
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-02-2012 , 16:46   Re: Compiler Help
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
It's this thing I call "debugging". EDIT: I guess I should elaborate here. I commented every line starting at line 283 to the end of the file.

Also, it's not a good idea to change a well published include file if the change is not negligible (in this case it is certainly not negligible). Unless you never plan on releasing your completed plugin to the public. Just remove the semicolon pragma and all will be good.
From what i gather the error means the variable is to small for all of the text once its substituted. Am i correct?

I made the variable larger and still receive the same error. and by larger i mean i went from the small number up to 2k in increments of 100.

Edit:
Or is it from the compiler saying that the text line is too large...

LOL if thats the case (which couldnt be changed) is there away to save all the same data with out such a long ass string.

Last edited by Doc-Holiday; 01-02-2012 at 17:00.
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2012 , 17:00   Re: Compiler Help
Reply With Quote #6

Quote:
Originally Posted by Doc-Holiday View Post
From what i gather the error means the variable is to small for all of the text once its substituted. Am i correct?
No, it has nothing to do with the variable itself. It's a compiler limitation, IIRC. Search for the many threads that have the same issue.
__________________
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-02-2012 , 17:12   Re: Compiler Help
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
No, it has nothing to do with the variable itself. It's a compiler limitation, IIRC. Search for the many threads that have the same issue.
So i have to make multiple queries to save/load my data due to the size of the string correct?

Edit: I dont know much about sql so please dont be SUPER harsh lol. but is this something i would have to do

Create 2 tables one saving half the data the second one saving the rest. Or is there away to append one query to the next.

like this

Query 1: player id, name, class1, class2
Query 3: class3, class4, class5, class 6

And have them added to the same entry on the DB?

(Not a seperate issue still trying to fix the first one)

According to exolent he said you can

Quote:
Originally Posted by Exolent[jNr] View Post
The string is too long for the compiler.

Solutions:
- Format the string into the variable one piece at a time. <---What does he mean by this?
- Execute each query separately.
using mulitple formatex ? and add two separate strings together before the query?

EDIT:!!! Ignore the above..

I think i figured out what i had to do.

PHP Code:
        formatex(szQueryOnecharsmax(szQueryOne), "REPLACE INTO `XpTable` (`player_id`, `player_name`, `player_total_xp`, `player_class_assault_xp`, `player_class_specops_xp`, `player_class_sniper_xp`, `player_class_engineer_xp`, `player_class_medic_xp`, `player_class_support_xp`)");
        
formatex(szQueryTwocharsmax(szQueryTwo), "VALUES (`%s`, `%s`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`);"g_szAuthID[id], szNameg_XP[id][TotalXP], g_XP[id][XP][CLASS_ASSAULT], g_XP[id][XP][CLASS_SPECOPS], g_XP[id][XP][CLASS_SNIPER], g_XP[id][XP][CLASS_ENGINEER], g_XP[id][XP][CLASS_MEDIC], g_XP[id][XP][CLASS_SUPPORT]);
        
formatex(szQuerycharsmax(szQuery), "%s %s"szQueryOneszQueryTwo); 

Last edited by Doc-Holiday; 01-02-2012 at 17:28.
Doc-Holiday is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-02-2012 , 17:17   Re: Compiler Help
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
Search for the many threads that have the same issue.
I can't tell you any more than that because I don't know for sure.
__________________

Last edited by fysiks; 01-02-2012 at 17:18.
fysiks is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 01-02-2012 , 17:35   Re: Compiler Help
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
I can't tell you any more than that because I don't know for sure.
See edit above
Doc-Holiday is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 01-02-2012 , 17:35   Re: Compiler Help
Reply With Quote #10

Quote:
Originally Posted by Doc-Holiday View Post
So i have to make multiple queries to save/load my data due to the size of the string correct?
No. The problem is the length of the line in editor, so it will work if you do this:
PHP Code:
formatex(szQuerycharsmax(szQuery), "REPLACE INTO `XpTable` (`player_id`, `player_total_xp`, `player_class_assault_xp`, `player_class_specops_xp`, `player_class_sniper_xp`, `player_class_engineer_xp`, `player_class_medic_xp`, `player_class_support_xp`) VALUES (`%s`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`);"g_szAuthID[id], g_XP[id][TotalXP], g_XP[id][XP][CLASS_ASSAULT], g_XP[id][XP][CLASS_SPECOPS], g_XP[id][XP][CLASS_SNIPER], g_XP[id][XP][CLASS_ENGINEER], g_XP[id][XP][CLASS_MEDIC], g_XP[id][XP][CLASS_SUPPORT]); 
->
PHP Code:
formatex(szQuerycharsmax(szQuery), "REPLACE INTO `XpTable` (`player_id`, `player_total_xp`, `player_class_assault_xp`, `player_class_specops_xp`, `player_class_sniper_xp`, `player_class_engineer_xp`, `player_class_medic_xp`, `player_class_support_xp`) VALUES (`%s`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`, `%d`);"
g_szAuthID[id], g_XP[id][TotalXP], g_XP[id][XP][CLASS_ASSAULT], g_XP[id][XP][CLASS_SPECOPS], g_XP[id][XP][CLASS_SNIPER], g_XP[id][XP][CLASS_ENGINEER], g_XP[id][XP][CLASS_MEDIC], g_XP[id][XP][CLASS_SUPPORT]); 
If you want to keep whole formatex function in a single line, or if the string "REPLACE ...." itself is too long then you just need to create the whole things using parts like this:
PHP Code:

new pos
pos 
+= formatex(szQuery[pos], charsmax(szQuery)-pos"REPLACE INTO `XpTable` (`player_id`, `player_total_xp`, `player_class_assault_xp`, `player_class_specops_xp`,");
pos += formatex(szQuery[pos], charsmax(szQuery)-pos" `player_class_sniper_xp`, `player_class_engineer_xp`, `player_class_medic_xp`, `player_class_support_xp`)");
pos += formatex(szQuery[pos], charsmax(szQuery)-pos" VALUES (`%s`, `%d`, `%d`,"g_szAuthID[id], g_XP[id][TotalXP], g_XP[id][XP][CLASS_ASSAULT]);
pos += formatex(szQuery[pos], charsmax(szQuery)-pos" `%d`, `%d`, `%d`, `%d`, `%d`);"g_XP[id][XP][CLASS_SPECOPS], g_XP[id][XP][CLASS_SNIPER], g_XP[id][XP][CLASS_ENGINEER], g_XP[id][XP][CLASS_MEDIC], g_XP[id][XP][CLASS_SUPPORT]); 
__________________
Impossible is Nothing
Sylwester is offline
Reply



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 15:42.


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