cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
smithwoosley
Level II

Radio Box to Text

How can I turn a selection from a radio box into text?  Trying below with no luck.  Or is there some other simpler solution?

 

win = New Window( "Radio Box",
	<<Modal,
	<<ReturnResult,
	Panel Box( "Select",
		rbox = Radio Box( {"A-CMP-1", "A-CMP-2"} ),
		toolcode = rbox<<get text;
	),
);

DSNString= "Driver={SQL Server}; SERVER=rb; DATABASE=FAB; UID=fab; ";

sqlStr=

"
select vcLotCode, vcToolCode
from EDB.dbo.tFABDATA
where vcLotCode like 'Lot.1234'
and vcToolCode like '"|toolcode|"'
	
";

dt = Eval(Substitute(Expr(dt=Open Database(DataSource,sqlcode,"Lots");),Expr(sqlcode),sqlstr,Expr(DataSource),DSNString));
2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Radio Box to Text

I believe your issue is your concatenation operators.  In JSL a concatenation operator is  ||, not | as in your example

toolcode="zippy";

sqlStr=

"
select vcLotCode, vcToolCode
from EDB.dbo.tFABDATA
where vcLotCode like 'Lot.1234'
and vcToolCode like '"||toolcode||"'
	
";
Jim

View solution in original post

smithwoosley
Level II

Re: Radio Box to Text

Ah, that was one problem.

 

Also had to use "get selected" instead of "get text".  Also had to move "get selected" outside of the new window parenthesis.

 

Works now.  Thanks!

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Radio Box to Text

I believe your issue is your concatenation operators.  In JSL a concatenation operator is  ||, not | as in your example

toolcode="zippy";

sqlStr=

"
select vcLotCode, vcToolCode
from EDB.dbo.tFABDATA
where vcLotCode like 'Lot.1234'
and vcToolCode like '"||toolcode||"'
	
";
Jim
smithwoosley
Level II

Re: Radio Box to Text

Ah, that was one problem.

 

Also had to use "get selected" instead of "get text".  Also had to move "get selected" outside of the new window parenthesis.

 

Works now.  Thanks!

pmroz
Super User

Re: Radio Box to Text

You don't have to do as much manipulation for the call to the database.  Also evalinsert makes the sql a little cleaner.

win = New Window( "Radio Box",
	<<Modal,
	<<ReturnResult,
	Panel Box( "Select",
		rbox = Radio Box( {"A-CMP-1", "A-CMP-2"} ),
		toolcode = rbox << get selected;
	),
);

DSNString= "Driver={SQL Server}; SERVER=rb; DATABASE=FAB; UID=fab; ";

sqlStr = evalinsert(
"select vcLotCode, vcToolCode
   from EDB.dbo.tFABDATA
  where vcLotCode like 'Lot.1234'
    and vcToolCode like '^toolcode^'");

dt = open database(dsnstring, sqlstr, "Lots");