phuzionz Posted June 29, 2007 Report Share Posted June 29, 2007 Hi guys, can anabody help me please In my VI, when i press on a certain row he gives me a 1 at that index, but when i choose another row(index), the output array is fully erased. I want that he leave the previousreults in the output array. Thanks for helping, jeroen Quote Link to comment
alukindo Posted June 29, 2007 Report Share Posted June 29, 2007 Hi: In your code, each time the event fires, you are re-initializing the input array to nothing. I changed your code so that the re-initialization occurs only once outside the event structure. In this case, you will have to wire the array data line through each of your event cases. .. I hope this helps Anthony Quote Link to comment
phuzionz Posted June 29, 2007 Author Report Share Posted June 29, 2007 No It's not correct, You must know that my output array stands for a the itemsymbol's of the multicolimnlistbox. Thus, when i press row one, an itemsymbel must appear at index 0, that's my meaning with the program. Jeroen Quote Link to comment
Ton Plomp Posted June 29, 2007 Report Share Posted June 29, 2007 QUOTE(phuzionz @ Jun 28 2007, 08:03 PM) No It's not correct, You must know that my output array stands for a the itemsymbol's of the multicolimnlistbox.Thus, when i press row one, an itemsymbel must appear at index 0, that's my meaning with the program. Jeroen Hi Jeroen, I don't fully get what you want.. Hope this code helps, it tracks the number of time a certain row is clicked: http://forums.lavag.org/index.php?act=attach&type=post&id=6264''>http://forums.lavag.org/index.php?act=attach&type=post&id=6264'>http://forums.lavag.org/index.php?act=attach&type=post&id=6264 Good luck, Ton As long it's not huiswerk Quote Link to comment
phuzionz Posted June 29, 2007 Author Report Share Posted June 29, 2007 No guys, sorry for the bad communication! I have add a new VI to explai it more clearly. When you start the VI, you can press on the multicolumn, there appears a itemsymbol. But now, How can i prevent that my output array shift's, when i press at the same place. For example: I press at index 0, itemsymbol appears at index 0, I press again index 0 to eraese that item, now there appaers at index one an item, how an i prevent this? Thanks Jeroen Quote Link to comment
sam Posted June 29, 2007 Report Share Posted June 29, 2007 I don't know what you are really doing but if you want to prevent a condition that already has happened from happing again you need to perform some kind of search, which I don't see in your code. Quote Link to comment
orko Posted June 29, 2007 Report Share Posted June 29, 2007 QUOTE(phuzionz @ Jun 28 2007, 01:29 PM) When you start the VI, you can press on the multicolumn, there appears a itemsymbol. But now, How can i prevent that my output array shift's, when i press at the same place.For example: I press at index 0, itemsymbol appears at index 0, I press again index 0 to eraese that item, now there appaers at index one an item, how an i prevent this? Two things need to happen: 1) Use "Replace Array Subset" instead of "Insert Into Array" to change(replace) elements without making the array any larger. With the Insert, you were adding an element to the array everytime your event fired. 2) Because "Replace Array Subset" will cause an error if you try to replace an element that doesn't exist yet, you have to initialize your array to the proper size first. This happens to be the same size as the array of ItemNames in the multicolumn listbox. This is how I got your code to work. Let me know if you need more clarification. http://forums.lavag.org/index.php?act=attach&type=post&id=6267''>http://forums.lavag.org/index.php?act=attach&type=post&id=6267'>http://forums.lavag.org/index.php?act=attach&type=post&id=6267 Quote Link to comment
phuzionz Posted June 30, 2007 Author Report Share Posted June 30, 2007 To Orko, This was very helpfull, thank you To all, I really appreciate the help! Quote Link to comment
phuzionz Posted December 11, 2007 Author Report Share Posted December 11, 2007 Dear Forummembers, How can i prevent that labview automatically add some rows when i want to insert something on the last possible row. Please, Take a look in my example. 1. Start the example 2. Double Click on the last row 3. Probably you have seen the strange behavior Thanks, Jeroen Quote Link to comment
phuzionz Posted December 12, 2007 Author Report Share Posted December 12, 2007 Can nobody help me on this topic? Br, Jeroen Quote Link to comment
JDave Posted December 12, 2007 Report Share Posted December 12, 2007 QUOTE(phuzionz @ Dec 11 2007, 08:27 AM) Can nobody help me on this topic? There is a VI that is missing (to initialize the array). I tried to reproduce what you were seeing, but I think if you included the Init VI it may help. Quote Link to comment
phuzionz Posted December 13, 2007 Author Report Share Posted December 13, 2007 QUOTE(JDave @ Dec 11 2007, 05:56 PM) There is a VI that is missing (to initialize the array).I tried to reproduce what you were seeing, but I think if you included the Init VI it may help. Sorry, i have upload the new VI! Quote Link to comment
hooovahh Posted December 13, 2007 Report Share Posted December 13, 2007 I don't fully understand your question. I downloaded your code and ran it and it seems to behave as I would expect it. When you double click a cell it will add the letter "a" to it, but only for a 6 x 10 grid (because that is what is initialized) Could you please explain the behavior you are seeing. Also I noticed your sub VI simply initializes a 2D array of string. For future reference this is built into LabVIEW, right click the "Initialize Array" and say add dimension. If you created this VI for some other reason disregard my comment. Quote Link to comment
JDave Posted December 14, 2007 Report Share Posted December 14, 2007 QUOTE(phuzionz @ Dec 10 2007, 07:36 AM) Dear Forummembers,How can i prevent that labview automatically add some rows when i want to insert something on the last possible row. Please, Take a look in my example. 1. Start the example 2. Double Click on the last row 3. Probably you have seen the strange behavior It is not that rows are being added, rather the first row is being reset to the normal height. This seems to occur when the 'Names' property is set. You can reset the height each time you set the 'Names' property. If you see a jitter in the display, you need to insert a "Defer Panel Updates" property. There may be a better way, but I can't see one at the moment. Also it is unnecessary to set the height multiple times -- the entire row has the same height. Remove the 'For' loop entirely and remove the second 'Height' property in your property node. http://lavag.org/old_files/monthly_12_2007/post-1519-1197517805.gif' target="_blank"> David Quote Link to comment
phuzionz Posted December 14, 2007 Author Report Share Posted December 14, 2007 QUOTE(hooovahh @ Dec 12 2007, 11:36 PM) I don't fully understand your question. I downloaded your code and ran it and it seems to behave as I would expect it. When you double click a cell it will add the letter "a" to it, but only for a 6 x 10 grid (because that is what is initialized) Could you please explain the behavior you are seeing. Also I noticed your sub VI simply initializes a 2D array of string. For future reference this is built into LabVIEW, right click the "Initialize Array" and say add dimension. If you created this VI for some other reason disregard my comment. When you want to add The "a" in de last row, he add some rows or he changes the display. I have also add some code to rewrite the multicolumn listbox. When you disabled that button you can see the "strange" behavior. To initiliazes a 2D array, your method is much easier. QUOTE(JDave @ Dec 13 2007, 04:54 AM) It is not that rows are being added, rather the first row is being reset to the normal height. This seems to occur when the 'Names' property is set. You can reset the height each time you set the 'Names' property. If you see a jitter in the display, you need to insert a "Defer Panel Updates" property. There may be a better way, but I can't see one at the moment. Also it is unnecessary to set the height multiple times -- the entire row has the same height. Remove the 'For' loop entirely and remove the second 'Height' property in your property node. David Hey David, the "Defer Panel Updates" property seems not be working. But you are right when you are saying that the behavior pops up when you write somthing to the property "itemnames" Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.