Since posting, I've experimented and find that Param1() returns -1 if there is no P parameter, so it is -1, not 0 as I had thought, that you must avoid as a legal value if you wish to detect whether there is a P word. Same for Q and S.
So, the code I am now using looks like:
PVal=Param(1)
If PVal=-1 Then PVal=GetVar(nnn) Else SetVar(nnn, PVal) End If
This picks up the previous value, so acting 'sticky' like the X,Y,Z values in G0, for instance.
This behaviour of Param1() etc doesn't seem to be documented.
If anyone is interested, my code bends and skews text characters so they fit correctly around a sundial. I convert every G0 and G1 to an Mmmmm.
Chris Lusby Taylor