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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 filename as workbook name

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
alkamid Posted - 10/13/2010 : 01:59:36 AM
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?
1   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 10/13/2010 : 05:22:45 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000