expected token: ";", but found "-rational value-"
#1

Hi guys,

how can I avoid error 001: expected token: ";", but found "-rational value-"?
pawn Код:
new
    array[ ][ ] =
    {
        { "60.0, -2246.547607, 552.029174, 38.925197, 18690.0, -2252.406494, 555.362243, 35.215824, 18690.0, -2249.920410, 557.339660, 35.215824,   18689.0, -2251.859130, 555.984008, 38.925197, 18691.0, -2248.750244, 556.749572, 38.521794, 18691.0, -2249.956787, 553.360473, 38.425197, 18689.0, -2246.768310, 547.283569, 38.925197, 18689.0, -2240.525390, 547.284240,      38.925197, 18690.0, -2241.839355, 549.670837, 38.921794, 18690.0, -2252.776367, 549.112731, 35.215824, 18690.0, -2245.066406, 553.146118, 38.921794, 18689.0, -2240.755615, 556.708435, 38.921794, 18691.0, -2240.952880, 554.352661, 38.421794, 18690.0, -2239.985839, 557.265991, 35.215824" }
    }
;
Thanks.
Reply
#2

Remove the " at the start and end. That denotes a string - which that is not.
Reply
#3

Put "{" and "}" after each coordinate!


Should be like this, am not sure:
pawn Код:
new array[ ][ ] = {
{ "60.0" }, { "-2246.547607" }, { ... }
};
Reply
#4

Quote:
Originally Posted by fiki574_CRO
Посмотреть сообщение
Put "{" and "}" after each coordinate!


Should be like this, am not sure:
pawn Код:
new array[ ][ ] = {
{ "60.0" }, { "-2246.547607" }, { ... }
};
Why? That isn't even necessary. MP2's suggesting is the one the topic starter should look to.
Reply
#5

No no no, I need string. If I cut text(if I make it small) it doesn't gives an error. It's because string is too big, but I don't know how to avoid this.
Reply
#6

The string is too long indeed, it's about 646 characters and the error is gone when I tried a small string. You could maybe use strcat to merge multiple smaller strings together.

Why do you need such a long string anyway?
Reply
#7

Later, I wanted to write all floats to an array using sscanf, but... I found a better solution, look at my last post in this topic .
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)