This code is called from GridAfterRowColChange. Does it mean, what it re-executes each time anyway? Can we put this particular line in Init of the form, so page caption would be updated automatically each time thisform.pnAddresses changed?
>Nadya,
>
>writeexpression() allows the expression to be re-evaluated at runtime...IOW, I think if thisform.pnaddresses changes at during runtime, the caption will change without this block of code being executed again.
>
>>Hi everybody,
>>
>>In my colleague's code I see the following:
>>ThisForm.Cpageframe1.Page1.Wgpageframe1.Page1.writeexpression('Caption',[=("Current Record"+" < SNIP > ...
>>ThisForm.Cpageframe1.Page1.writeexpression('Caption',[=("Property Addr - ("+ALLTRIM(STR(Thisform.pnaddresses))+")")])
>>ThisForm.Cpageframe1.Page1.Wgpageframe1.Page1.cmdpreviousaddress.refresh()
>>ThisForm.Cpageframe1.Page1.Wgpageframe1.Page1.cmdnextaddress.refresh()
>>
>>Do you know, why he is using WriteExpression and not just Page1.Caption = ...
>>What is benefit/disadvantage of one way to another?
>>
>>Thanks in advance.
If it's not broken, fix it until it is.
My Blog