Needs help with printfunction!

HiI try to get a printfunction after some wishes from management. And i hate it. First the want a question if you are sure you want to print it.

If yes they want ordinary printdialog to pop up so the could select printer, no of copies and landscape or not or cancel if the want again (This not work, i get no return).

I think it should work great if it cancel instead of printing my doc even if i choose cancel in my printdialog.

So after @Command([FilePrintSetup]) and

@Command( [FilePrint]) a want it to cancel if you press cancel, now its printing anyway.

As you see in my code all work almost but not the way they want. How will a go further with this. Im really new in this so my LS is not so god yet. I use trail/error programming when it comes to LS.

All help appreciate,

numCopies:=“”;

fromPage:=“”;

toPage:=“”;

ifDraft:=“”;

ifView:=“”;

formName2:=“plan”;

formName:=“plan_print”;

breakType:=“”;

ifReset:=“”;

startDate:=“”;

endDate;“”;

tmp:= @Prompt([YesNo]; “Print”; “Are you sure…”);

@If(tmp !=0;

 @Success;

 @Return("")

);

@Command([SwitchForm];formName);

@Command([FilePrintSetup]);

@Command( [FilePrint] ; numCopies; fromPage; toPage; ifDraft; ifView; formName; breakType; ifReset; startDate; endDate);

@Command([EditDeselectAll]);

@Command([SwitchForm];formName2)

Regards

Leon

Subject: Needs help with printfunction!

Have you tried something like…

tmp:= @Prompt([YesNo]; “Print”; “Are you sure…”);

@If(tmp !=0;

@Command([FilePrint]);

@Return(“”)

)