Forum Replies Created
-
AuthorReplies
-
The other annoying thing is that the parser checks all of your procs when you go to save it, so if you comment something out with the issue listed above, and then move to a different proc, when you try to save the one you are working on, it will flag the error in the other proc. This is confusing.
What do you use in place of script editor? I know notepad++ has some tcl abilities.
Thanks all. I did manage to get this working. Probably not as slick as it could be, nor pretty, but it works.
Hi Doug, XLate scripts are not TCL. But you can include TCL scripts and snippets in an XLate. Either within a Call or Pre/Post Proc steps. XLates do not support a CASE/SWITCH statement, but TCL does have a SWITCH. When I need a SWITCH, I often put this logic in Call. I have not implemented Java Script yet, as we need to upgrade our Cloverleaf machine first. Rob Abbot presented last week in Fulda, Germany that the latest version of Cloverleaf also supports Python. Best Regards from Berlin, Jim
Can you explain how you would use Call to handle a SWITCH? Lots of interesting concepts in this product.
When I hovered over the table open icon in the table tool I noticed it said lookup table, and then discovered the Lookup Table Configurator. lol.
It is working now.
It is a bit clunky, but works. It would be way quicker with javascript. Maybe there are tricks to populate that? Looks like I could open it in notepad and copy and paste if I had a lot of entries.
Is that lookup table icon supposed to do something? it seems to be grayed out.
That is interesting. I gave it a go, but of course did something wrong. I opened excel and added A to one column and XR to the second, along with a few more, then saved it as .xlsx, which was the only option for their web version.
I ran it through a converter to change it to a .csv file, and then renamed it to .tbl and moved it into the Xlate folder.
In Cloverleaf, I selected the FROM and TO pieces, and put the name of that file under Table, but when I saved and ran the testing tool it failed.
Is there a way to create this table without using excel? Does script editor help with this?
The problem I have is that tcl in the GUI is somewhat handicapped without a switch statement. Is there something similar?
I tried using IF Else, but it ends up with this massive amount of code that is much easier orchestrated using javascript.
tcl
{ { OP IF }
{ ERR 0 }
{ COND { 0(0).MSH(0).#4(0).[0] eq =”A”} }
{ THENBODY {
{ { OP COPY }
{ ERR 0 }
{ IN =”XR” }
{ OUT {{2(0).1(0).0(0).OBR(0).#24(0).[0]}} }
}
}}
{ ELSEBODY {
{ { OP IF }
{ ERR 0 }
{ COND { 0(0).MSH(0).#4(0).[0] eq =”B”} }
{ THENBODY {
{ { OP COPY }
{ ERR 0 }
{ IN =”CR” }
{ OUT {{2(0).1(0).0(0).OBR(0).#24(0).[0]}} }
}
}}
{ ELSEBODY {
{ { OP COPY }
{ ERR 0 }
{ IN =”OT” }
{ OUT {{2(0).1(0).0(0).OBR(0).#24(0).[0]}} }
}
}}
}
}}javascript
switch (msh4) {
case “A”:
obr24 = “XR”;
break;
case “B”:
obr24 = “CR”
break;
default:
obr24 = “OT”;
}Is there a way to handle a pick list with tcl in the GUI?
I have had about 4 hours training so far. Next course begins in November, but my company is moving ahead with Cloverleaf now so I am getting my boots dirty. I have a lot of js code ready to go, just need to know how to implement it.
-
AuthorReplies