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
Belsinga Posted - 06/22/2010 : 04:07:42 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8E
Operating System: Win XP

Hello (again),

I am working on a dialog box in Labview, but I do not know how to use the selected variable. (The following script returns only a blank line). How can I use the selected value from P?

Regards,

*********************************
i = 8;
%P = "000 010 030 050 100 200 300 400";

getnumber (Sample1) i:P
(Filter Type);
type $(Sample1);
4   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 06/22/2010 : 10:49:09 PM
Hi,

If you have renamed the workbook or worksheet with the data file name when you import data, you can use the %H string register to get the active window title or wks.name$ to get the worksheet name.

getnumber (%H) i:P (Filter Type);

or

getnumber (%(wks.name$)) i:P (Filter Type);

Also, you can use the string defined by yourself.

string myStr$ = "MySample";
getnumber (%(myStr$)) i:P (Filter Type);


For accessing the variable defined inside case:{}, The "later on" means outside the "switch"? If so, with the braces for each case, you need to use the @global to force global scope.

switch (i)
{
	case 1:
	{  // in braces
		@global = 1;  // begin global scope
		string str = "string defined in case 1";
		@global = 0;  // end global scope
		type "000";
		break;
	}
	case 2:
	{	.
		.
	        .
	}
        // other cases...	
}
str$ = ;  // can get the string defined in case 1


Penn
Belsinga Posted - 06/22/2010 : 10:24:54 AM
And yet another question regarding the "switch" statement:

If I define a variable inside a case:{}, how can I access it later on?
Belsinga Posted - 06/22/2010 : 05:45:23 AM
OK thanks,

Is it possible to type a generic string instead of "Sample1", e.g. the name of the sample that is in the filename?
Penn Posted - 06/22/2010 : 04:47:33 AM
Hi,

The return value is the index of the selected item. To get the item value in your issue, you can use the switch command.

For example:

i = 8;
%P = "000 010 030 050 100 200 300 400";

getnumber (Sample1) i:P
(Filter Type);
type $(i); 

switch (i)
{
	case 1:
		type "000";
		break;
	case 2:
		type "010";
		break;
	case 3:
		type "030";
		break;
	case 4:
		type "050";
		break;
	case 5:
		type "100";
		break;
	case 6:
		type "200";
		break;
	case 7:
		type "300";
		break;
	case 8:
		type "400";
		break;
}


Penn

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