Multiple errors on compilation
#1

Hello everybody.
I got a sick problem that I cant resolve it. I see all seems to be ok but they are not and I cant find a solution.

Please help me to find out what happen inside here.

ERROR CODE
Код:
./includes/dynamic/gates.pwn(1063) : error 075: input line too long (after substitutions)
./includes/dynamic/gates.pwn(1064) : error 037: invalid string (possibly non-terminated string)
./includes/dynamic/gates.pwn(1064) : error 017: undefined symbol "UPDATE"
./includes/dynamic/gates.pwn(1064) : error 017: undefined symbol "gates"
./includes/dynamic/gates.pwn(1064) : fatal error 107: too many error messages on one line
LINES
Код:
stock SaveGate(id) 
{
	mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `gates` SET \
		`HID`=%d, \
		`Speed`=%f, \
		`Range`=%f, \
		`Model`=%d, \
		`VW`=%d, \
		`Int`=%d, \
		`Pass`='%e', \
		`PosX`=%f, \
		`PosY`=%f, \
		`PosZ`=%f, \
		`RotX`=%f, \
		`RotY`=%f, \
		`RotZ`=%f, \
		`PosXM`=%f, \
		`PosYM`=%f, \
		`PosZM`=%f, \
		`RotXM`=%f, \
		`RotYM`=%f, \
		`RotZM`=%f, \
		`Allegiance`=%d, \
		`GroupType`=%d, \
		`GroupID`=%d, \
		`RenderHQ`=%d, \
		`Timer`=%d, \
		`Automate`=%d, \
		`Locked`=%d, \
		`TIndex`=%d, \
		`TModel`=%d, \
		`TTXD`='%e', \
		`TTexture`='%e', \
		`TColor`=%d, \ <-1063
		`Facility`=%d \ <-1064
		WHERE `ID`=%d",
		GateInfo[id][gHID],
		GateInfo[id][gSpeed],
		GateInfo[id][gRange],
		GateInfo[id][gModel],
		GateInfo[id][gVW],
		GateInfo[id][gInt],
		GateInfo[id][gPass],
		GateInfo[id][gPosX],
		GateInfo[id][gPosY],
		GateInfo[id][gPosZ],
		GateInfo[id][gRotX],
		GateInfo[id][gRotY],
		GateInfo[id][gRotZ],
		GateInfo[id][gPosXM],
		GateInfo[id][gPosYM],
		GateInfo[id][gPosZM],
		GateInfo[id][gRotXM],
		GateInfo[id][gRotYM],
		GateInfo[id][gRotZM],
		GateInfo[id][gAllegiance],
		GateInfo[id][gGroupType],
		GateInfo[id][gGroupID],
		GateInfo[id][gRenderHQ],
		GateInfo[id][gTimer],
		GateInfo[id][gAutomate],
		GateInfo[id][gLocked],
		GateInfo[id][gTIndex],
		GateInfo[id][gTModel],
		GateInfo[id][gTTXD],
		GateInfo[id][gTTexture],
		GateInfo[id][gTColor],
		GateInfo[id][gFacility],
		id+1
	);
	mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
	return 0;
}
I tryed this string szMiscArray to make it 1024 and 4096 and didnt work aswell. So there must be another way to resolve it.
Reply
#2

The best way is to use Zeex's compiler which increases the limit of input line: https://github.com/pawn-lang/compiler/releases
Other option is strcat: https://sampwiki.blast.hk/wiki/Strcat

Do you really need to update all these columns?
Reply
#3

You can split and join them with strcat before the query.

Or just split the mysql_format (as long you have enough string buffer size) like this:
Код:
mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `gates` SET \
		`HID`=%d, \
		`Speed`=%f, \
		`Range`=%f, \
		`Model`=%d, \
		`VW`=%d, \
		`Int`=%d, \
		`Pass`='%e', \
		`PosX`=%f, \
		`PosY`=%f, \
		`PosZ`=%f, \
		`RotX`=%f, \
		`RotY`=%f, \
		`RotZ`=%f, ",
		GateInfo[id][gHID],
		GateInfo[id][gSpeed],
		GateInfo[id][gRange],
		GateInfo[id][gModel],
		GateInfo[id][gVW],
		GateInfo[id][gInt],
		GateInfo[id][gPass],
		GateInfo[id][gPosX],
		GateInfo[id][gPosY],
		GateInfo[id][gPosZ],
		GateInfo[id][gRotX],
		GateInfo[id][gRotY],
		GateInfo[id][gRotZ]
	);
mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "%s\
		`PosXM`=%f, \
		`PosYM`=%f, \
		`PosZM`=%f, \
		`RotXM`=%f, \
		`RotYM`=%f, \
		`RotZM`=%f, \
		`Allegiance`=%d, \
		`GroupType`=%d, \
		`GroupID`=%d, \
		`RenderHQ`=%d, \
		`Timer`=%d, \
		`Automate`=%d, \
		`Locked`=%d, \
		`TIndex`=%d, \
		`TModel`=%d, \
		`TTXD`='%e', \
		`TTexture`='%e', \
		`TColor`=%d, \
		`Facility`=%d \
		WHERE `ID`=%d",
		szMiscArray,
		GateInfo[id][gPosXM],
		GateInfo[id][gPosYM],
		GateInfo[id][gPosZM],
		GateInfo[id][gRotXM],
		GateInfo[id][gRotYM],
		GateInfo[id][gRotZM],
		GateInfo[id][gAllegiance],
		GateInfo[id][gGroupType],
		GateInfo[id][gGroupID],
		GateInfo[id][gRenderHQ],
		GateInfo[id][gTimer],
		GateInfo[id][gAutomate],
		GateInfo[id][gLocked],
		GateInfo[id][gTIndex],
		GateInfo[id][gTModel],
		GateInfo[id][gTTXD],
		GateInfo[id][gTTexture],
		GateInfo[id][gTColor],
		GateInfo[id][gFacility],
		id+1
	);
mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
Reply
#4

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
The best way is to use Zeex's compiler which increases the limit of input line: https://github.com/pawn-lang/compiler/releases
Other option is strcat: https://sampwiki.blast.hk/wiki/Strcat

Do you really need to update all these columns?
Yep, I need all that updates cuz is a full gate creator+editor.

Also, that Zeex compiler still give me other errors so is not so great. With normal pawno or Sublime, I dont get this king of error.

Код:
\include\YSI\internal\..\internal\..\y_scriptinit.inc(62) : fatal error 100: cannot read from file: "a_samp"
Reply
#5

Believe me, it is better to spend few minutes and fix these other errors and then enjoy writing very long lines without the default pawncc complaining about it.

I will write the steps I followed:
Downloaded compiler: https://github.com/pawn-lang/compile....7-windows.zip
Extracted and placed from pawnc-3.10.7-windows\bin to pawno\include and replaced all of them.
Created a pawn.cfg file into pawno folder and wrote in it: -d3-Z
-Z is for compatibility mode (or alternative #pragma compat 1)

To test YSI, I downloaded latest version: https://github.com/pawn-lang/YSI-Inc...rchive/4.x.zip
also amx_assembly: https://github.com/Zeex/amx_assembly/archive/master.zip
Extracted both.
Inside of folder "YSI-Includes-4.x", I created a new folder called "amx" and I placed all files from "amx_assembly-master" to "YSI-Includes-4.x\amx" folder.
Last, I moved all files and folders from "YSI-Includes-4.x" to pawno\include folder and that's it.

Now about including YSI libraries (say y_iterate), I use:
pawn Код:
#include <a_samp>
// YSI libraries after a_samp
#include <YSI\y_iterate>
// any other include
Using slash will fail, this will not work:
pawn Код:
#include <YSI/y_iterate>
Reply
#6

Quote:
Originally Posted by RoboN1X
Посмотреть сообщение
You can split and join them with strcat before the query.

Or just split the mysql_format (as long you have enough string buffer size) like this:
Код:
mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `gates` SET \
		`HID`=%d, \
		`Speed`=%f, \
		`Range`=%f, \
		`Model`=%d, \
		`VW`=%d, \
		`Int`=%d, \
		`Pass`='%e', \
		`PosX`=%f, \
		`PosY`=%f, \
		`PosZ`=%f, \
		`RotX`=%f, \
		`RotY`=%f, \
		`RotZ`=%f, ",
		GateInfo[id][gHID],
		GateInfo[id][gSpeed],
		GateInfo[id][gRange],
		GateInfo[id][gModel],
		GateInfo[id][gVW],
		GateInfo[id][gInt],
		GateInfo[id][gPass],
		GateInfo[id][gPosX],
		GateInfo[id][gPosY],
		GateInfo[id][gPosZ],
		GateInfo[id][gRotX],
		GateInfo[id][gRotY],
		GateInfo[id][gRotZ]
	);
mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "%s\
		`PosXM`=%f, \
		`PosYM`=%f, \
		`PosZM`=%f, \
		`RotXM`=%f, \
		`RotYM`=%f, \
		`RotZM`=%f, \
		`Allegiance`=%d, \
		`GroupType`=%d, \
		`GroupID`=%d, \
		`RenderHQ`=%d, \
		`Timer`=%d, \
		`Automate`=%d, \
		`Locked`=%d, \
		`TIndex`=%d, \
		`TModel`=%d, \
		`TTXD`='%e', \
		`TTexture`='%e', \
		`TColor`=%d, \
		`Facility`=%d \
		WHERE `ID`=%d",
		szMiscArray,
		GateInfo[id][gPosXM],
		GateInfo[id][gPosYM],
		GateInfo[id][gPosZM],
		GateInfo[id][gRotXM],
		GateInfo[id][gRotYM],
		GateInfo[id][gRotZM],
		GateInfo[id][gAllegiance],
		GateInfo[id][gGroupType],
		GateInfo[id][gGroupID],
		GateInfo[id][gRenderHQ],
		GateInfo[id][gTimer],
		GateInfo[id][gAutomate],
		GateInfo[id][gLocked],
		GateInfo[id][gTIndex],
		GateInfo[id][gTModel],
		GateInfo[id][gTTXD],
		GateInfo[id][gTTexture],
		GateInfo[id][gTColor],
		GateInfo[id][gFacility],
		id+1
	);
mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
It works perfect. Thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)