x=0 --define a variable and set it to 0 (call it whatever you like, 'x' is just an example)
function CEButton1Click(sender) --this is the function that gets called when you press the button 'CEButton1'
if(x==0)then --check if the variable is equal to 0
--something --place your code here (whatever you want to happen if the button is pressed for the first time)
x=1 --set the variable to 1 so that next time the button is pressed something else happens
else --if the variable wasn't equal to 0 in the first place
--something else --place your code here (whatever you want to happen when the button is pressed for the second time)
x=0 --set the variable back to 0 so that next time the button is pressed your first code is executed again
end --end of 'if'
end --end of the button
so,
Code:
gButtonOnW = 0
function CEButton1Click(sender)
addresslist=getAddressList()
if (gButtonOnW ==0) then
control_setCaption(UDF1_CEButton1, "OFF")
local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "Hack1")
memoryrecord_unfreeze(memrec)
gButtonOnW = 1
else
-- control_setCaption(UDF1_CEButton1, "Wait")
-- gButtonOnW=true
local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), "Hack1")
memoryrecord_freeze(memrec)
control_setCaption(UDF1_CEButton1, "ON")
gButtononW = 0
end
end
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum