Loading ...
Sorry, an error occurred while loading the content.

16444Re: [peditors] Newbie pScript question

Expand Messages
  • Steven Hill
    Feb 1, 2002
    • 0 Attachment
      At 07:42 -0500 1/2/02, Paul Nevai wrote:

      ># Sorry, not sure I included enough context: The number I want to increment is
      ># in my document: I can't see how to get a number in a document into a
      ># variable (e.g. cut/copy commands don't set $$ [which I don't complain about,
      ># though if the selected text was all digits within the acceptable range...])
      >I see... Steve? Can be done?

      I spent a lot of time thinking about this a while back, and
      ultimately opted for the date stamp idea. I think the following
      method will work but I decided (having discovered that a datestamp
      did the job) not to try it out, so there may be a problem I haven't
      thought about...

      You need a script that copies the number, goes into scriptPad and
      finds and then pastes into the /&varSet[] function. Finally you need
      to launch the script that contains the /&varSet[] function and
      increment it the variable before printing it. Obviously you need an
      unique identifier in the script to allow you to find the /&varSet[]
      function, something like:

      /&varSet [$0, xxxx]/*PASTEHERE*/

      then you can find 'PASTEHERE', move the cursor back and then select
      word. Note that the starting script needs to be *after* the second
      script in scriptPad or it just finds the instruction for typing

      The other approach using a calculator application would also work. I
      would recommend EasyCalc as this allows you to paste a number,
      perform an operation on it and then copy the result. I posted a
      number of scripts that used EasyCalc a long time ago, and a search
      for 'EasyCalc' in the forum archive should allow you to find them.

      Hope this helps...

    • Show all 20 messages in this topic