Is the button name really UseThis
, with no space? If there is a space in the button title, your code won’t work.
Oh wait, the name of the button is UseThis
with no space, so that isn’t the problem.
Well, I just tried your code, and it worked just fine for me. I did it several times and it appended just great. Well, actually it pre-pended, since that what you programmed it to do.
So I have no idea why this isn’t working for you.
This isn’t the problem, but I do have some thoughts about this code. I am wondering why you have this line:
showvariables lComment
Since this is a local variable, it cannot possibly be displayed anywhere. This line doesn’t really hurt anything, but I would take it out. Actually, I see another showvariables
higher up, I think that should be removed also, again, it does nothing but cause a slight delay.
Also, is there any particular reason why you are using the cell
statement? I think an assignment would be clearer.
Comment = lDate+" — "+lComment+¶+"---"+¶+oldComment
Back in the day, the Panorama macro recorder would record data entry using the cell statement, but usually I can’t think of any reason to use it now. However, the cell
statement should work, I don’t think that is the reason for your problem.
Here is a revised/simplified version of your program. I also switched it to append the new comment on the end, since you said that was what you wanted. This code works for me, I hope it works for you.
let newComment = ""
supergettext newComment,{title="Enter new comment…" height=50% width=6in buttons="New Comment:120;Cancel:80"}
if info("dialogtrigger") match "Cancel" return endif
Comment = sandwich("",Comment,cr()+"---"+cr())+datepattern(today(),"YYYYMMDD")+" - "+newComment