Hecl Builder

Easy Mobile Applications

HECLet_Example_Test
Download: .jad .jar
2.0/5 Average rating:

MIDP Version: 1.0
Description: Test the example code in emulator. It contain the same command extendsions like HECLet.
Last updated: Tue Oct 12 10:19:06 +0000 2010 by olamed

# http://www.olamed.de/j2me/v101/example.test.hcl

set frmH [form]
set objH [list]
proc NewH {} {
  global objH
  set objH [list]
}
proc AddH {obj} {
  global objH
  lappend $objH $obj
}
proc GetH {int} {
  global objH
  return [lindex $objH $int]
}
proc SetH {int obj} {
  global objH
  lset $objH $int $obj
  return $obj
}
proc UrlH {url} {
  eval [hget [http.geturl $url] data]
}
proc RmsH {rms} {
  set strR ""
  foreach intR [sort [rms.list $rms]] {
    append $strR [rms.get $rms $intR]
    append $strR "\n"
  }
  eval $strR
}
proc Heclet {} {
# >>> BEGIN HECLET CODE >>>

NewH
AddH [list Menu1 Menu2]
AddH [choicegroup label ""]

proc Gui {} {
  set frmH [form label "Example" code {
    SetH 1 [choicegroup label "Menu:" list [GetH 0]]
    cmd label "OK" code {Hdl mnu}
  }]
  setcurrent $frmH  
}

proc Hdl {strC} {
  if {eq $strC mnu} {
    set frmH [form label "Hdl $strC" code {
      string [lindex [GetH 0] [getprop [GetH 1] selected]]
      cmd label "OK" code Gui
    }]
    setcurrent $frmH      
  }
}

Gui

# <<< END HECLET CODE <<<
}
Heclet


Note: If you have trouble with the applets on this site, you might try upgrading your Jave Runtime Environment, in order to get the "Next-Generation Java Plug-In", available for download here: http://download.java.net/jdk6/