MIDP Version: 2.0
Description: Universal HECL-code for MIDP1 + MIDP2 graphical user interface (Proof of concept). Last updated: Tue Jan 13 19:44:55 +0000 2009 by
olamed
# switch.hcl - Hecl script compartible with MIDP1 and MIDP2
# MIDP-X-Switch (detect hecl1 and hecl2 commands)
set HECL 0
foreach command [intro commands] {
if {eq $command "form"} {
set HECL 1
}
if {eq $command "lcdui.form"} {
set HECL 2
}
}
# MIDP-1-Code (hecl code as string)
if {eq $HECL 1} {
set lstEval {
{set frmMenu [form label "MIDP1"]}
}
}
# MIDP-2-Code (hecl code as string)
if {eq $HECL 2} {
set lstEval {
{set frmMenu [lcdui.list -title "MIDP2"]}
}
}
# MIDP-X-Eval (execute hecl code)
foreach strEval $lstEval {
puts $strEval
eval $strEval
}
proc HeclSetCurrent {gui} {
global HECL
eval "global $gui"
if {eq $HECL 1} {
eval [append {setcurrent $} $gui]
}
if {eq $HECL 2} {
eval [append {$} $gui { setcurrent}]
}
}
HeclSetCurrent frmMenu