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
 Simple GetN example
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

OriginConfused

2 Posts

Posted - 05/24/2016 :  2:45:02 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

Sorry to post such a simple question but I've been unable to find the answer after some searching.

I'm trying to create a simple dialog box that takes in some input from a user in order to create a plot from an active workbook. The problem is that the filename variable is not being set properly, instead of creating a file with the user input it instead prints "--", indicating that the variable name isn't truly being set.

For example, if I set fileName to "file 1" in the pop up dialog box, the name displayed in the project explorer simply appears as "--".

My code is shown below



// First, declare the variables to be used:

double freq;
string fileName$;
int xcol , ycol;
 
// Use GetN dialog to collect user data:
getn
(Frequency) freq
(File Name) fileName$
(X Column) xcol
(Y Column) ycol
(Display Name);

plotxy iy:=col($(ycol)) plot:=200 ogl:=[<new template:=singTemp name:= $(fileName$)>]





Any help is much appreciatged!

Hideo Fujii

USA
1582 Posts

Posted - 05/24/2016 :  5:35:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi OriginConfused,

The GetN command should be okay, but the way referencing the graph name in plotxy should be like:
plotxy iy:=col($(ycol)) plot:=200  ogl:=[<new name:="%(fileName$)">];
Hope this helps.

--Hideo Fujii
OriginLab
Go to Top of Page

OriginConfused

2 Posts

Posted - 05/24/2016 :  5:57:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yup that works great

Thanks for the help
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