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

Re: variations on a theme...

Expand Messages
  • Ben B
    On Wednesday, Nov 05, 2003 BHCS wrote regarding variations on a theme... ; ... Hi Bill, The error was being generated at ^!Open ^%path%^%scratchdoc%
    Message 1 of 2 , Nov 6, 2003
    • 0 Attachment
      On Wednesday, Nov 05, 2003
      BHCS wrote regarding "variations on a theme...";

      > .. produces an Information dialog that says the "File
      > R:\Clients\BillableHrs\temp-tasks.txt does not exist." I click Ok & it
      > prompts me to save with a name that matches the whattask+period vars but
      > I'm still in the source doc with nothing selected & it'll get renamed
      > unless I [Cancel] out of the Save dialog.

      Hi Bill,

      The error was being generated at
      ^!Open "^%path%^%scratchdoc%"
      (^!SetDebug is useful for troubleshooting these things)
      because the regexp failed and thus the file was never created.

      > Also, in this case I want to only write the 1st, 2nd, 3rd, 5th & 8th
      > fields to the new doc but I want to delete all of the fields from the
      > source record - how is that done?

      Here's another clip you can try. See if this does what you want.
      Watch out for line wrap, every line begins with either a command (begins
      with ^!) or a label (begins with :) except for a couple of comments (;)
      preceding lines likely to wrap.

      H="variations"
      ^!Set %path%="R:\Clients\BillableHrs\"
      ^!Set %whattask%=^?[What Task?]
      ^!Set %period%=^?[What Billing Period?]
      ^!Set %filename%=^%path%^%whattask%-^%period%.txt
      ^!Set %tempfile%=^$GetTempFile$
      ^!Jump Doc_Start
      :repeat
      ^!Find ""^%whattask%",".*",".*",".*",".*",".*",".*",".*"" RSI
      ^!IfError finish
      ^!AppendToFile "^%tempfile%" ^$GetSelection$^%NL%
      ^!Replace "^$GetSelection$" >> ""
      ^!GoTo repeat
      :finish
      ^!Open "^%tempfile%"
      ;long line follows
      ^!Replace "{".*"},{".*"},{".*"},".*",{".*},".*",".*",{".*"}" >> "\1,\2,\3,\4,\5" RAWS
      ^!IfFileExist "^%filename%" warn Else Skip_3
      :warn
      ^!Skip ^%filename%^%NL%already exists!^%NL%^%NL%Overwrite?
      ^!GoTo choose
      ^!Save AS ^%filename%
      ^!DeleteFile ^%tempfile%
      ^!GoTo Exit
      :choose
      ;long line follows
      ^!Save AS ^?{(T=S)Choose a different folder or change filename=^%filename%}
      ^!DeleteFile ^%tempfile%
      ; -----<end of clip<-----

      HTH
      Ben B
    Your message has been successfully submitted and would be delivered to recipients shortly.