SA-MP Forums Archive
sscanf question about format codes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: sscanf question about format codes (/showthread.php?tid=110800)



sscanf question about format codes - Dujma - 28.11.2009

Uhh I'm not shure how to explain this. Is it possible to skip one format code, like if I split MySQL row and I don't won't to load the third field.

Example:

The result line would be like

Код:
field1|field2|field3|field4|field5...
Lets say that the first two fields are strings and the rest of them are interger.

And I only want to load fields 1, 2, 4, 5... but not the third one.

Код:
sscanf(resultline, "ssddd", var1, var2, var3, var4, var5...
But what I'm trying to do is

Код:
sscanf(resultline, "ss(d)dd", var1, var2, var4, var5...
(d) - What should be there instead of d?

I tried to search but I did not get any results about this, and I tried to put something like this

Код:
sscanf(resultline, "ss dd", var1, var2, var4, var5...
or

Код:
sscanf(resultline, "ss0dd", var1, var2, var4, var5...
but it was not working.

Basicly what I'm trying is when I load the player I don't won't to load for example his password, ip, ban status because they are already loaded in some other part of the script.

I hope you understand what I mean...


Re: sscanf question about format codes - diesulke - 28.11.2009

I wish that i knew something about Sscanf xD


Re: sscanf question about format codes - UsaBoy91 - 28.11.2009

if you want to delimitter them , you can use parameter p

eg

pdddd

will encrypt

d|d|d|d ( eg; 1|5|7|9 )


Re: sscanf question about format codes - Dujma - 28.11.2009

Quote:
Originally Posted by Angel φ
if you want to delimitter them , you can use parameter p

eg

pdddd

will encrypt

d|d|d|d ( eg; 1|5|7|9 )
I know that I just forgot to put it on first post

p|ssddd

I know how to use it and all I just want to know if it is possible to skip one or more parameters.