02-15-2023 12:29 PM
I seem to be having an issue where I'm now not initialising enough cells for data to go into. However if I initialise too many I'll have blank spaces, and while the data is in memory it won't actually get displayed on the listbox as there isn't enough ItemNames initialised in the array. Any help?
I can provide screenshots as needed
02-15-2023 12:38 PM
Instead of initializing an array, use "Place Element In 2D Array.vim" (attached)
like this:
02-15-2023 01:40 PM - edited 02-15-2023 01:41 PM
@TylerHW wrote:
I can provide screenshots as needed
As we discussed in your other thread, you just need to do it correctly. No need to initialize anything! A 2D array has no "cells", just elements. Once you get the 2D array of strings for the item names, you know how big it is.
02-15-2023 01:44 PM
Okay let's stick to this thread.
I understand that arrays don't have cells, i'm just using that word for ease. I'm referring to the element of the listbox. My issue is that I have no idea how big it'll be from the start. I'm scanning the directory for the files and editing the array (listbox) to contain the files info, as it goes through a for loop.
02-15-2023 02:09 PM
Hi Tyler,
@TylerHW wrote:
My issue is that I have no idea how big it'll be from the start. I'm scanning the directory for the files and editing the array (listbox) to contain the files info, as it goes through a for loop.
So you are using an autoindexing FOR loop - good.
Why do you need to know the resulting array size before starting the loop?
@TylerHW wrote:
I'm referring to the element of the listbox.
The "element" of a listbox os the index of the selected item.
I think now you are referring to items of the listbox - as this is their name in the list of properties…
02-15-2023 02:15 PM
I've attached my project below, in essence, I need to make a media organiser, which takes media files and organises them into playlists. I'm defining these playlists using xml files. The media must also be associated with it's path, a comment, a category and an image. Which is also determined by xml files and then all of this info is passed into the vi. You can see my processes in the project.
Sorry for being vague I'm just a bit stressed trying to get this to work 🙂
02-15-2023 02:17 PM
My issue stems from when I'm trying to add media to a potential new playlist, "create playlist" tab, it gets to about 7 elements displayed in the listbox and then doesn't display anymore, however if i click let's say 3 more times to add media to the playlist, i then have to remove them 3 elements again before the change is displayed. If you give the VI a go you can see what I mean
02-15-2023 02:36 PM - edited 02-15-2023 02:48 PM
Hi Tyler,
many of us don't like RAR files because they require proprietary software. Please use ZIP instead!
@TylerHW wrote:
I've attached my project below, in essence, I need to make a media organiser, which takes media files and organises them into playlists. I'm defining these playlists using xml files. The media must also be associated with it's path, a comment, a category and an image. Which is also determined by xml files and then all of this info is passed into the vi. You can see my processes in the project.
Ok, why do you still initialize the listbox with this huge array constant? This is from "Main.vi":
Is there a reason to initialize to 3 rows ad 501 columns of empty strings and just one "0" in the last element???
You have been told to initialize with an empty array constant instead!
The same problems happens in here:
Why do you initialize with an array of 9×5 empty strings???
Why do you use ReplaceArrayElement when you want to build an array of unknown size in "Fill Playlist Array File Names"??? Use AutoIndexing instead!!!
See this as suggestion:
For my taste you are using way too much local variables/"value" property nodes: data should be kept in wires and shift registers! Controls/indicators should be used to input/display data, but not to buffer data…
02-15-2023 02:47 PM
Not sure why my previous reply didn't send, for both of the examples you sent me that's not what I have in my project? Not sure where u got that from.
I'm going to attach a ZIP to this reply
02-15-2023 02:54 PM
Sorry for my weird responses too. For some reason the forum only likes to display parts of your message after refereshing 🙂
I'm going to implement your example and see how that works out 🙂
Cheers