| Author |
Topic  |
|
|
mkoetse
Netherlands
Posts |
Posted - 03/12/2004 : 09:18:02 AM
|
Hello all,
Did anyone write a import filter for multiple ascii files. Actually all I need is a way to store multiple selected file(name)s, that I select from a directory, in a string. The string can subsequently be processed with a loop. How to get the filenames in a string? Or, is there a smarter way of doing this?
Marc
P.S. I do not want to import an entire diractory as described in: http://www.originlab.com/forum/topic.asp?TOPIC_ID=2952
Edited by - mkoetse on 03/12/2004 09:21:41 AM |
|
|
Mike Buess
USA
3037 Posts |
Posted - 03/12/2004 : 10:18:54 AM
|
Hi Marc,
GetMultiOpenBox() creates a multiple file selection dialog and saves the selections to a string array. There is an example in Global Functions->User Interface Controls->GetMultiOpenBox. One could use that instead of FindFiles() in the topic you cited.
...If you have Origin 7.0 you need to use LabTalk's fdlog.multiOpen() instead. Call it from Origin C like this...
LabTalk.fdlog.multiOpen()
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 03/12/2004 10:39:34 AM |
 |
|
|
mkoetse
Netherlands
Posts |
Posted - 03/12/2004 : 12:45:09 PM
|
Dear Mike, Thanks a lot. I had to upgrade to 7.5SR2, but now it works as charm. Just a little question: is it true that one can only select 8 files, or has this to do with a maximum string length of the array?
Marc
|
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 03/12/2004 : 1:49:46 PM
|
Hi Marc,
I wasn't aware that there is a limit on either number of files or array length, but haven't really used the dialog much. Which dialog box are you using? (bMultiSelection argument) It might make a difference.
Mike Buess Origin WebRing Member |
 |
|
|
mkoetse
Netherlands
Posts |
Posted - 03/12/2004 : 2:40:18 PM
|
I'm using the default: bMultiSelection = true. It's not clear to me what multi selection open or multi-open means.
Marc
|
 |
|
|
Mike Buess
USA
3037 Posts |
Posted - 03/12/2004 : 2:53:29 PM
|
Hi Marc,
They are two different dialogs. One (presumably the dialog you are using) is the standard dialog in which you Ctrl+click or Shift+click multiple files to add their names to File name line. The other is like the Import->Multiple ASCII dialog that has a list box at the bottom and an Add Files button.
Mike Buess Origin WebRing Member |
 |
|
|
eparent
118 Posts |
Posted - 03/12/2004 : 3:36:10 PM
|
Hello,
The Origin C GetMultiOpenBox function takes the following arguments:
StringArray& saFilePaths, StringArray &saFiletypes, LPCSTR lpcszPath = NULL, LPCSTR lpcszFilename = NULL, LPCSTR lpcszDialogName = NULL, bool bMultiSelection = true
This dialog is always multiple selection. The last argument determines what dialog to use. If true then it uses LabTalk's FDlog.Open dialog. If false then it uses LabTalk's FDlog.MultiOpen dialog.
There was a bug with using FDlog.Open for multiple selection. The memory used for holding the file names was not large enough. This bug is trackered as item #5957 and has been fixed for the next release. Until the next release the current work around is to use the FDlog.MultiOpen dialog by setting GetMultiOpenBox's bMultiSelection to false.
Thanks.
|
 |
|
|
mkoetse
Netherlands
Posts |
Posted - 03/12/2004 : 4:41:13 PM
|
thanks to you!
|
 |
|
| |
Topic  |
|