sscanf question about format codes
#1

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...
Reply
#2

I wish that i knew something about Sscanf xD
Reply
#3

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

eg

pdddd

will encrypt

d|d|d|d ( eg; 1|5|7|9 )
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)