strins
#1

Sorry if its a foolish mistake..
Код:
public Response(index, response_code, data[])
{
    if(response_code == 200)
    {
        if(data[0]=='s')
        {
            new NILLV[6]= "NoInf";
            for(new i=0; i<=strlen(data); i++)
	    {
		    if(data[i]==','&&data[i+1]==',')
		    {
		        printf("%i", i);
			strins(data,NILLV,i,strlen(data)+9);//stops Here
		    }
	     }
              print(data);
         }
     }
}
Reply
#2

what are u using this code for
if u can explain then maybe we can make another non-buggy one
Reply
#3

I am using it to get the country name from a site.. Using HTTP..
Sometimes it doesnt send any value and the value become
"United States, BlablaBla,,,,IP"
"Country, State, Code, Longitude, Lattitude, IP"
So, I want to edit it to : "United States, Blablabla, No Info, No Info, No Info, IP"
Reply
#4

You can use strmid to extract the name. You'll need to know at what position the country's name starts and ends though (that depends on the data of the callback).
Reply
#5

I want to add the Details.. I dont want to remove anything from that.
Reply
#6

Cux I am using sscanf to extract the details.. Which seems to be working fine but when 4" , "s come together, it seems to fail..
Reply
#7

For anyone who might come accross like this thing in future. This is how I fixed it. rep+ for both who tried to help.. Much love
Код:
            for(new i=0; i<=14; i++)
			{
			    if(strfind(data, ",,",true)!=-1)
			    {
			        s_Cnt=strfind(data, ",,",true);
			        new S_Size;
					S_Size=strlen(data)+10;
					new MSG_Splitter[200];
					strmid(MSG_Splitter, data, 0, s_Cnt+1);
					strdel(data, 0, s_Cnt+1);
					format(data, S_Size, "%sNo_Info%s", MSG_Splitter, data);
				}
			}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)