explode_ function.
#1

Hi.
I'm looking for this function, if someone has it, post it please.
Thanks.
Reply
#2

http://forum.sa-mp.com/index.php?topic=110557.0
Reply
#3

I prefer explode() from YSI's misc.own because it is probably faster and efficient...
Reply
#4

Sure, Joe?
Reply
#5

Isn't this Westie's function?
and thanks Westie, I was looking for this.
Reply
#6

Quote:
Originally Posted by Seif_
Quote:
Originally Posted by MenaceX^
Isn't this Westie's function?
and thanks Westie, I was looking for this.
No, explode is a PHP function. Westie made a pawn version of it.
I took the PHP functions and made an as direct port as possible.
Reply
#7

Quote:
Originally Posted by Seif_
Quote:
Originally Posted by MenaceX^
Isn't this Westie's function?
and thanks Westie, I was looking for this.
No, explode is a PHP function. Westie made a pawn version of it.
That's what I meant...


Erhm, Westie, you deleted the codes from there.. Anywhere to find them?
Reply
#8

Recheck the topic.
Reply
#9

Just did.
Reply
#10

Got some veery strange and hard to debug issues with Westie's explode().

It compiles with no warnings, it runs, but while my test /dbg command reaches it, i get "Server: Unknown command" in my SAMP game.

The code portion (if any1 curious) would be like:
Код:
	// 1. build the query
	new query[1024];
	format(query, sizeof(query), "SELECT * FROM %s WHERE %s='%s'", table, row, id);

	SendClientMessage(playerid, 0xFFFFFFAA, query); 	// dbg
	
	// 2. execute and catch result
	samp_mysql_query(query);
	samp_mysql_store_result();

	new line[2048];
	new message[256];

	if(samp_mysql_fetch_row(line)) {

		format(message, sizeof(message), "Record: %s", line);
	    SendClientMessage(playerid, 0xFFFFFFAA, message);  // dbg

		// Describe
		// Explode result
		// assign associative (?)

		new result[4][256];
		explode(result, line, "|");   // ** here it fails
		

		format(message, sizeof(message), "Found: %s", result[1]);
		SendClientMessage(0, 0xFFFFFFAA, message);
	}
	else SendClientMessage(playerid, 0xFFFFFFAA, "Nothing found...");
I get the proper result in line var as f.e. 3|Kyeno|SomeSecretPass|SomeOtherStuff

Where do i find YSI's one?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)