I've got a form in our help desk program that I recently added for the Help Desk Manager to use. It's purpose is to show logged in users. It has an ontimer event to refresh the screen every minute. What I'd like it to do is also display a text message on the form showing a message its refreshing. As soon as I add that code it won't refresh anymore. Below is what I've done that is not working. If I remark out the part about displaying the message, it refreshes ok (no message). Please take a look and let me know what I've done wrong here. Thanks!!! (My form is set to counter = 60 seconds)
dim shared counter as N
counter = counter + 1
If counter = 1 then
'Refresh data in Form 'LoggedInUsers' at parent level.
DIM object_name as C
object_name = ":"+"LoggedInUsers"
DIM varP_Object as p
'Get a pointer to the specified object
varP_Object = obj(object_name)
'Check if the specified object exists
if .not. is_object(varP_Object) then
ui_msg_box("Error","The object '"+object_name+"' does not exist.",ui_stop_symbol)
else
'Can only resynch data in View mode, so save record first to be sure that layout is in View mode.
varP_Object.Commit()
varP_Object.Resynch()
varP_Object.Refresh_Layout()
end if
'Go to first record in Form 'LoggedInUsers' at Browse1 level.
DIM object_name as C
object_name = ":"+"LoggedInUsers:Browse1"
DIM varP_Object as p
'Get a pointer to the specified object
varP_Object = obj(object_name)
'Check if the specified object exists
if .not. is_object(varP_Object) then
ui_msg_box("Error","The object '"+object_name+"' does not exist.",ui_stop_symbol)
else
varP_Object.fetch_first()
end if
'Show message that form is refreshing
dim shared ptr as p
ptr = topparent.VAR-"vBB
vBB = convert_type(a5_eval_expression("=\"BIG BROTHER IS REFRESHING\""),"C")
dim shared ptr as p
ptr.show()
n=toseconds(time())
wait_until(toseconds(time()) " n+3)
ptr.hide()
counter = 0
End if
dim shared counter as N
counter = counter + 1
If counter = 1 then
'Refresh data in Form 'LoggedInUsers' at parent level.
DIM object_name as C
object_name = ":"+"LoggedInUsers"
DIM varP_Object as p
'Get a pointer to the specified object
varP_Object = obj(object_name)
'Check if the specified object exists
if .not. is_object(varP_Object) then
ui_msg_box("Error","The object '"+object_name+"' does not exist.",ui_stop_symbol)
else
'Can only resynch data in View mode, so save record first to be sure that layout is in View mode.
varP_Object.Commit()
varP_Object.Resynch()
varP_Object.Refresh_Layout()
end if
'Go to first record in Form 'LoggedInUsers' at Browse1 level.
DIM object_name as C
object_name = ":"+"LoggedInUsers:Browse1"
DIM varP_Object as p
'Get a pointer to the specified object
varP_Object = obj(object_name)
'Check if the specified object exists
if .not. is_object(varP_Object) then
ui_msg_box("Error","The object '"+object_name+"' does not exist.",ui_stop_symbol)
else
varP_Object.fetch_first()
end if
'Show message that form is refreshing
dim shared ptr as p
ptr = topparent.VAR-"vBB
vBB = convert_type(a5_eval_expression("=\"BIG BROTHER IS REFRESHING\""),"C")
dim shared ptr as p
ptr.show()
n=toseconds(time())
wait_until(toseconds(time()) " n+3)
ptr.hide()
counter = 0
End if
Comment