display all records from a database table in gui
#3

Here's something that may or may not be considered a protip: OnDialogResponse in DIALOG_STYLE_LIST case also packs the inputtext array so for example if you select "ID: 12" from the list dialog, the inputtext array will be "ID: 12" in your callback.

This eliminates the need for any sort of extra arrays to keep the row order in mind so the listitem can later be compared. But what you need to do is use sscanf to parse the "12" as an integer from the "ID: 12" string.

Or wait, actually, if you have a string like this:
"ID: 12"
you always know the number begins on index 6, so you can, I assume:
pawn Код:
new ID = strval(string[6]);
Give it a try!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)