Raised This Month: $ Target: $400
 0% 

Compiler won't compile with long string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 10-26-2013 , 05:20   Compiler won't compile with long string
Reply With Quote #1

Hello everyone,

I wanted to add some SQL Stuff to my new plugin, and it worked fine until now, but now I've added two more tables in my SQL Query and now the Compiler gets to 25 % CPU (full single-core), generates a empty .amx file and the compiler screen stays black.

My Code :
PHP Code:
new szTemp[1024]
        
formatex(szTemp,charsmax(szTemp),"INSERT INTO `%s` ( `steamid` , `name` , `pass` , `currency` , `primary_weapon` , `primary_skin` , `primary_magazine`, `primary_bpammo` , `primary_laser` , `secondary_weapon` , `secondary_skin` , `secondary_magazine`, `secondary_bpammo` `secondary_laser` , `hatid` , `playermodel` , `tertiary_skin`) VALUES ('%s','%s','%s','%i','weapon_mp5navy', '0', '30', '60', '0', '0', '0', '0', '0', '0', '0', '1', '1');"Table_UserDataszSteamIdszQuotedNameszQuotedPassSTART_MONEY
Maybe the compiler can't handle a so long string?
If I remove the two new things it compiles fine.
__________________

Last edited by Kia; 10-26-2013 at 05:20.
Kia is offline
DWIGHTpN
Senior Member
Join Date: Jan 2013
Location: Romania.
Old 10-26-2013 , 05:44   Re: Compiler won't compile with long string
Reply With Quote #2

Try:
Code:
new szTemp[1024]
        
formatex(szTemp,charsmax(szTemp),
             "INSERT INTO `%s` ( `steamid` , `name` , `pass` \
             , `currency` , `primary_weapon` , `primary_skin` , \
             `primary_magazine`, `primary_bpammo` , `primary_laser` \
             , `secondary_weapon` , `secondary_skin` ,\
            `secondary_magazine`, `secondary_bpammo` \
            `secondary_laser` , `hatid` , `playermodel` , `tertiary_skin`) \
            VALUES ('%s','%s','%s','%i','weapon_mp5navy', '0', '30', '60', '0',\
            '0', '0', '0', '0', '0', '0', '1', '1');", 
            Table_UserData, szSteamId, szQuotedName, szQuotedPass, START_MONEY)
DWIGHTpN is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 10-26-2013 , 05:47   Re: Compiler won't compile with long string
Reply With Quote #3

Break the string and use add().
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 10-26-2013 at 05:47.
Shooting King is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 10-26-2013 , 05:57   Re: Compiler won't compile with long string
Reply With Quote #4

Well, I had this problem in the past, and I created Thread about it, but now I know who case that, search in your plugin, for long lines and try to break them like DWIGHTpN said
TheDS1337 is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 10-26-2013 , 06:16   Re: Compiler won't compile with long string
Reply With Quote #5

I made two strings using add() and now it's working, thanks.
__________________
Kia is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-26-2013 , 06:28   Re: Compiler won't compile with long string
Reply With Quote #6

If you are not afraid to compile things and if for your own use, you may want give a try to compile the compiler. Allowing more characters in one line is easy to change, just a define in a file (don't remember which one).
__________________
Arkshine is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 10-26-2013 , 07:37   Re: Compiler won't compile with long string
Reply With Quote #7

Quote:
Originally Posted by Arkshine View Post
If you are not afraid to compile things and if for your own use, you may want give a try to compile the compiler. Allowing more characters in one line is easy to change, just a define in a file (don't remember which one).
Thanks for that suggestion, I think I'll do that.
__________________
Kia 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 23:14.


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