LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read files in directory, generate link list

Hi, I am trying to read all files in a directory and then display them on the front panel in some fashion (maybe a listbox...) that would allow the user to click on any one of the file links, opening the file.

The files are html files that will open in IE.


My problem is figuring out how to create a list of links on the front panel, does anyone have some ideas?

Thanks,
Ryan (7.0)
Ryan

LV 7.1
0 Kudos
Message 1 of 7
(3,666 Views)
You put the filenames in a listbox and capture clicks on the list via an event handler where you can call a routine to open the file linked to the clicked name.

The "link" is done in your code. I wouldn't go the route of pasting hyperlinks onto the VI panel.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 7
(3,660 Views)
Hi,

I have something similar created sometime back at this link

Hope it helps! 🙂

Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 7
(3,657 Views)
Thanks for the replies guys, I am looking at both right now.

Ian, I may have found a small glitch in your vi's, it seems to stop reading the file name as soon as a COMMA is encountered.

Is there anyway I can make it recognize spaces?

Thanks a lot guys.

Message Edited by esa_paranoid on 06-28-2005 08:00 AM

Message Edited by esa_paranoid on 06-28-2005 08:00 AM

Ryan

LV 7.1
0 Kudos
Message 4 of 7
(3,655 Views)
Hi,

😛 I wasn't expecting my test report filename (in .html), at that time, to have both "," thus did not realise that 😛 You might just have to do little more wiring work to suit your needs.

By the way, where you want to have "spaces" recognised?
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 5 of 7
(3,639 Views)
oops, sorry ian. I orginally thought spaces were where it was getting hung up, then edited the message to say commas but missed that last one.

see my file names are basically abrv. dates...

Tue, Jun 30, 2005.html

Thanks for the help guys, hopefully I can figure it out.

Ryan
Ryan

LV 7.1
0 Kudos
Message 6 of 7
(3,636 Views)
If you have a new enough version of LabVIEW, you may consider using a tree control. That way, you can show the hierarchy of your files as well. You can set events to launch the files when double-clicking on the tree control items. Check out the LabVIEW examples for how to use the tree control. It is a bit of a pain, but works well once you get it figured out.
0 Kudos
Message 7 of 7
(3,622 Views)