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
 filename as workbook name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

alkamid

Poland
27 Posts

Posted - 10/13/2010 :  01:59:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: OriginPro 8 SR3
Operating System: Ubuntu 9.04 (wine)

Hello,

I'm using filenames to name my workbooks but it doesn't work properly with some filenames. This is the part of my code that deals with it:
filename$ = path.GetFileName(1)$;
newbook name:= filename$ option:=lsname;
plotxy iy:=[filename$]!(1,5) plot:=200;


It works fine with filenames that consist only of letters but it wouldn't work with "2162z.dat". I get an error:
Failed to resolve range string, VarName = iy, VarValue = [filename$]!(1,5)

How to force my filename$ to be a string?

larry_lan

China
Posts

Posted - 10/13/2010 :  05:22:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Book name cannot start with number. Or, Origin will automatically add a letter. So, the iy in plotxy X-Function cannot access to the correct workbook. You can:

1. Change your file name.

2. Try:

filename$ = "2162z.dat";
string strbkn$;
newbook name:= filename$ option:=lsname result:=strbkn$;
plotxy iy:=[strbkn$]!(1,5) plot:=200;


Thanks
Larry
OriginLab
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