Re: [Clip] Re: Totalling using clipboard
- dvdwriters12 wrote:
> I should have been more clear.
> Suppose I am working in another document and we have a price list:
> TOTAL = £
> I want to copy each price into the clipboard and have notetab in the
> background accumulate the value and return the result in the
> clipboard, without me switching to notetab.
> Ive tried but I dont think its possible.
A few questions.
Do you want to select each number individually or a column of numbers?
Are the numbers always in a column, as in the example?
Are the numbers always at the left margin as in the example?
Will the numbers always have the currency symbol included?
Do you deal in other currencies other than pounds, if so, which?
Possibly more questions later, depending on the answers to these.
"British Union Finds Dwarfs in Short Supply"
hrs ø hsavage@...
- = V5 MultiLine NoSorting TabWidth=30
H=";About this library"
; Clip by Don at htmlfixit dot com
If you start this thing and then paste numbers to the clipboard, you'll
get the total of those numbers back on the clipboard when you are done.
If you copy something that is not a number, then you get the total of
all copied numbers to the clipboard.
The next time you copy a number, it will continue on fresh.
;Set initial values for main variables
^!Set %CheckClipboard%=True; %PasteInfo%=0
;If user does not want to create a new document, skip this procedure
^!Prompt Number copy mode is now enabled to total all numbers copied,
copy an non-number to have get the total to the clipboard.
;Stop checking the Windows Clipboard
^!Prompt Number capturing stopped. Double-click on the "Start" Clip if
you want to continue
;If we are not supposed to check the Windows Clipboard, end this Clip
^!IfFalse ^%CheckClipboard% End
;If the size of the text in the Clipboard exceeds 255 characters, end
this Clip (unlikely to be a number)
^!If ^$GetClipboardSize$ > 255 End
;Copy Clipboard text into a variable
;if not number, prompt for whether to continue or end the clip
^!If "^$IsNumber("^%ClipboardText%")$" = "1" NUMBER ELSE TOTAL
;Play sound file if it exists
;End the Clip
;End the Clip
- Don - HtmlFixIt.com wrote:
> = V5 MultiLine NoSorting TabWidth=30It just occurred to me, didn't we have a discussion a while back that
> H=";About this library"
> ; Clip by Don at htmlfixit dot com
> If you start this thing and then paste numbers to the clipboard, you'll
> get the total of those numbers back on the clipboard when you are done.
> If you copy something that is not a number, then you get the total of
> all copied numbers to the clipboard.
> The next time you copy a number, it will continue on fresh.
you cannot trust isNumber? If so I may need to fine tune this thing a
little. I could be off here, does anyone else remember that discussion?
I didn't test my clip on anything but whole numbers.
When I started this clip, one of the ones I was looking at to remember
the onClipBoardChange bit was one I worked on in 2002. So I've seen a
lot of clips and I forget more than I remember probably :-)
> I didn't test my clip on anything but whole numbers.
> When I started this clip, one of the ones I was looking at to
> the onClipBoardChange bit was one I worked on in 2002. So I've seena
> lot of clips and I forget more than I remember probably :-)Thanks Don,
Yeah as you say it doesnt work on fractional numbers, but otherwise it
seems to work except it doesnt return the result in the clipboard
(which is easy enough to modify).
> Thanks Don,I have the solution around here to get it to work on fractional numbers.
> Yeah as you say it doesnt work on fractional numbers, but otherwise it
> seems to work except it doesnt return the result in the clipboard
> (which is easy enough to modify).
I'll try to do that when I get a second.
It should be putting the result on the clipboard. When you are done
totaling copy a non-number and you should have the result on the clipboard.
Try that again and let me know if it is working. If not, I'll have to
revisit. I should add that I am working in 4.95 pro.