OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: General Barron on 01 Jun 2005, 15:09:41

Title: Dialog ListBox command trouble...
Post by: General Barron 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:
Title: Re:Dialog ListBox command trouble...
Post by: THobson 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.
Title: Re:Dialog ListBox command trouble...
Post by: General Barron 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...