The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 import multiple selected files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mkoetse

Netherlands
Posts

Posted - 03/12/2004 :  09:18:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

mkoetse

Netherlands
Posts

Posted - 03/12/2004 :  12:45:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/12/2004 :  1:49:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

mkoetse

Netherlands
Posts

Posted - 03/12/2004 :  2:40:18 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I'm using the default: bMultiSelection = true. It's not clear to me what multi selection open or multi-open means.

Marc

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/12/2004 :  2:53:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

eparent

118 Posts

Posted - 03/12/2004 :  3:36:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.


Go to Top of Page

mkoetse

Netherlands
Posts

Posted - 03/12/2004 :  4:41:13 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks to you!

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000