about sscanf "enum" or "array"
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
Never store more than one value in a single column to begin with. On top of that, these variables you mention aren't even related to each other so it makes even less sense doing so.
Quote:
Originally Posted by ******
Посмотреть сообщение
M4D: That is not only quite a poor specifier, but also wrong.

iLuXing: "p<,>e<fffffii>" will work correctly, even for the first version of your enum - contrary to popular belief, arrays inside enums are not true arrays and can be treated as a set of flat variables:

pawn Код:
enum pStateInfo {
        Float:health,
        Float:armour,
        Float:position[3],
        interior,
        world
}
Is equivalent to:

pawn Код:
enum pStateInfo {
        Float:health,
        Float:armour,
        Float:position,
        interior = 5,
        world
}
The specifier you posted will (if I ever finish) work in the future, but IIRC that's only in the upcoming sscanf 3, not in the current sscanf 2 (and the major missing feature in v3 is enums currently).

Having said all that, Vince is right. This code is trying to poorly replicate the functionality of databases, which are already VERY good at storing multiple pieces of independent data. Don't second guess SQL!
Sorry, but I think : if I store those data at the same time, and I only loaded it on player spawned.
I think this method with sscanf is faster a little.

Should I store those in every single column ?
Reply


Messages In This Thread
about sscanf "enum" or "array" - by iLuXing - 23.12.2014, 08:40
Re: about sscanf "enum" or "array" - by M4D - 23.12.2014, 09:07
Re: about sscanf "enum" or "array" - by iLuXing - 23.12.2014, 09:23
Re: about sscanf "enum" or "array" - by M4D - 23.12.2014, 09:57
Re: about sscanf "enum" or "array" - by Vince - 23.12.2014, 10:34
Re: about sscanf "enum" or "array" - by iLuXing - 25.12.2014, 12:45

Forum Jump:


Users browsing this thread: 1 Guest(s)