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
 LabTalk Forum
 Automatic selection of 2nd file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rmtruji

USA
10 Posts

Posted - 04/21/2004 :  5:25:01 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I have a script that currently prompts the user to select a file using fdlog.MultiOpen(). Once the OK button is selected in the "Open" window, I want the script to automatically select a 2nd file from the same directory that has the same name as the original file plus underscore DR (filename_DR). Does anyone know how I can do this?

jlang

USA
Posts

Posted - 04/22/2004 :  3:49:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This might not work but you may try:

open -w %A_DR; // import the data named %A_DR

This is under the assumption that your first filename is passed to %A.

HTH
Go to Top of Page

sammi.song

China
46 Posts

Posted - 04/22/2004 :  10:37:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi rmtruji,

Maybe your selected files all have the 2nd files with a suffix "_DR". I hope the following scripts would be useful:

fdlog.MultiOpen();
loop (ii,1,FDlog.MultiOpen.Count)
{
win -t data; //open a new worksheet
Fdlog.Get(A, ii); //get the selected filename respectively
open -w %A; //import the current selected file into wks
%w=%H; //backup this wks name
win -t data; //open a new worksheet
win -a %H; //active this new wks
open -w %w_DR.dat; //import the data file named %A_DR.dat
};

Thanks,
Sammi
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