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
 getnumber

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
Stefan B Posted - 12/09/2016 : 2:52:22 PM
Hi,

I am improving the interface of my scripts. Therefore i have a few questions.

1) I was reading getn commands examples. I found this:

// Use :@BB for file and graph browsing
string fname$ = "C:\myproject.opj";
string grname$ = "Graph1";
getn (File Name) fname$:@BBFile (Graph) grname$:@BBGraph (Test @BB);
type fname$;
type grname$;


The description says , that i can choose multiple files, but it simply doesn't work. I can choose only one file. Can i somehow change this ?

2) Beside that i want to create the dialog box, where user chooses, whether to sort the columns after import on not. I have two concepts:

a) User chooses it like on this example : (in the box should be descending and ascending order, the text in the example is wrong ) :



b) User just mark the field if he wants to change the default order
(the text in the example is wrong):



I want to connect these operations (marking one of the fields) with some variables. For instance when the field (in second idea) is marked by user- the value of variable - int n=1; , if not n=0;

Best Regards,
Stefan B.
3   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 12/10/2016 : 12:59:15 AM
Hi Stefan,

I think “If” is better than “break” in this case.Please try:

if(!fname$=="")
{
    int count = fname.GetNumTokens(CRLF);
    count=;
    cancel=0;
}


Regards,
Yuki
OriginLab
Stefan B Posted - 12/09/2016 : 6:14:56 PM
Hi Hideo,

Of course it works :). I cannot belive, that solution is so simple. Sorry about that. I also added GetToken command so now i can use this window instead of dlgfile.


If u have any idea regarding question 2, i'd be really grateful.

I want to unify four dialogboxes i have in my sripts into one.

Problem solved, but i have an issue during testing :

int cancel;
for(i=1;i<3;i++)
{
run.section(,Menu);
if(cancel==1)
type -b error;
else 
type -b Ok;
};

[Menu]
j=0;
k=0;
cancel=1;
getn (Name 1:%(CRLF)second) str$ (Name 2:%(CRLF)) str1$  (File Name) fname$:@BBFiles (Option 1) j:2 (Option 2) k:2 (line1%(CRLF)line2%(CRLF)line3);
if(fname$=="")
break 1;
int count = fname.GetNumTokens(CRLF);
count=;
cancel=0;


When user doesn't choose any file or just press cancel button script should open dialogbox with message "error", if user chose files script should open dialogbox with message 'OK'.

Everytime i press cancel button or don't choose file script ends with following message in command window (it also happens happens everytime after the last iteration of the loop):

[Menu]J is illegal name for defining a variable
unknown error in expression assignment


I think, that script should work fine. What can be the reason ?

Best Regards,

Stefan B.
Hideo Fujii Posted - 12/09/2016 : 3:55:23 PM
Hi Stefan B,

First, let me write just for 1):

> The description says , that i can choose multiple files, but it simply doesn't work.

As the document(http://www.originlab.com/doc/LabTalk/ref/GetNumber-cmd#Using_Origin_C.27s_GetNBox_from_LabTalk)
says, "some allow browsing for more than one item. These are simply plural", you can write like:
getn (File Name) fname$:@BBFiles (Graph) grname$:@BBGraphs (Test @BB);
Works?

--Hideo Fujii
OriginLab


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