- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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));
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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||"'
";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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||"'
";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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");