Home   Help Search Login Register  

Author Topic: Dialog ListBox command trouble...  (Read 942 times)

0 Members and 3 Guests are viewing this topic.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Dialog ListBox command trouble...
« on: 01 Jun 2005, 15:09:41 »
Gar! I'm angry! Gar!

So, I've been working on a dialog, and I've been adding data to a list box using the "lbSetValue" command (used to set a number for a LB row). Later I retrieve that data with the "lbValue" command, and everything works like it should.

However, now I tried to add in some additional data in the LB using the "lbSetData" command (used to set a string for a LB row), in the exact same manner I was adding the first data. But when I try to get this info back using the "lbData" command, I get an empty string returned!

I'm not getting any error messages anywhere, I'm just not getting my data back. Any ideas what I might be doing wrong? Thanks! :wave:
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Dialog ListBox command trouble...
« Reply #1 on: 01 Jun 2005, 23:34:49 »
I am out of the country this week so can't check anything directly.  I have used lbsetValue in the way you describe and indeed it works.  I have not tried lbsetData.  I presume you are aware of Vektorboson's reference:
lbSetData [idc, _index, "Text"] -  Sets a string within the item with number _index. The string is non-visual and may be read through lbData

and that the syntax is correct.

It sounds like the value is not getting added to the rows of you list.

I can only suggest the crude work around that is to create an array of strings where the row number you put in the Value field is the index  of the array.  That way you could recover the 'Value' and then extract the string from your array.

Best I can do without access to my machine I'm afraid.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Dialog ListBox command trouble...
« Reply #2 on: 02 Jun 2005, 02:19:32 »
Ack!!! :crazy:

As usual, the problem is "operator error". The operator being me operating OFP, of course.

Turns out I was using the wrong local variable in the "index" field of the command. So my data was being added out in who-knows-where.

Whoo boy... I'll just hit 'solve' and hope this topic disappears quickly...
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!