Problem With Splitting Data
#1

-fixed-
Reply
#2

1) Use sscanf: (Im not sure if my code will work, not tested it, but you should get the point)
pawn Код:
sscanf(data, "p<,>a<i>[8]", newArray); // the "p" is the delimter, and the "a" is the array which type is integer and the array size is 8
2) As long as there's no other symbols than numbers, use Int, otherwise use Varchar and if it has .0 use Float.
Reply
#3

Thanks I'm trying now ...
Reply
#4

sorry for flood but didnt work
Reply
#5

Quote:
Originally Posted by liquid13
Посмотреть сообщение
sorry for flood but didnt work
What happened now? Any errors? Or just didnt work as it suppossed to?
Reply
#6

-fixed-
Reply
#7

Where's the query?
Reply
#8

Try this:
pawn Код:
new
    IDS[3000],
    ces[500];

sscanf(IDS, "p<,>a<i>[500]", ces);

new i = 0;

while(i < 500)
{
   printf("%d", ces[i]);
 
   i++;
}
Reply
#9

-fixed-
Reply
#10

Quote:
Originally Posted by liquid13
Посмотреть сообщение
yeah it worked thanks a lot. so can i try a thing like this :

pawn Код:
while(i < 500)
{
   if(ces[i]==theid)
{
//something
}
 
   i++;
}
if ces arrray has theid variable it 'll work right ?
Yes, it'll work:


pawn Код:
while(i < 500)
{
   if(ces[i] == 1234)
   {
         print("ces[%d] is 1234!!!", i);
    }
 
   i++;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)