Harish Srinivas bio photo

Harish Srinivas

“Autodidact with an insatiable thirst for learning something new everyday. Wearer of many hats. DevOp Engineer/Release Engineer, Security Engineer, Linux fanatic, Amateur photographer, Maker & Novice App developer.”

Email

I went ahead and tried creating my own application for the palm using PLUA , Once I went through the documentation it took about 10 minutes to code the application.

its a simple program to add 2 numbers and display the result. it can be extended to do something useful like calculating body mass index, or mortgage payments etc.

heres is the complete listing

ptitle("simple calc")
pmoveto(10,55)
text1=pfield(1,7,20)
print("+")
pmoveto(105,55)
text2=pfield(1,7,20)
print("=")
pmoveto(195,55)
text3=pfield(1,7,20,"",1,1)
pmoveto(50,100)
addButton=pbutton("add")
clrButton=pbutton("clear")
exitButton=pbutton("exit")
psetfocus(text1)
while 1 do
e,id = pevent()
if e == ctlSelect and id == addButton then
psettext(text3,(pgettext(text1)+pgettext(text2)))
end
if e == ctlSelect and id == exitButton then
if(pconfirm("do you really want to quit?")) then
break
end
end
if e == ctlSelect and id == clrButton then
psettext(text1," ")
psettext(text2," ")
psettext(text3," ")
end
end

will put in commented version and screenshots on my next post.