Post Reply 
catching numerical values
May. 17, 2005, 04:40 PM
Post: #1
 
Hi, I got question regarding catching numerical values. Here is the example

match: ([0-9])\1$SET(d=\1)$SET(t=$GET(d)+1)$ALERT($GET(t))
test text: 1

when you test this filter, it gives a popup: "1+1". I wish to see: "2" in the alert popup. How do I do that?

my intent is to catch text of the form

1<a href="index.html">[2][/url]

thanks.
Add Thank You Quote this message in a reply
May. 17, 2005, 05:00 PM
Post: #2
 
vowels;

Hi, and Welcome to our forum!

What you seem to be asking for is the display (in the Alert box) of the sum of an addition operation - am I correct? If that's the case, then we have to tell you 'sorry, no can do'. Proxo doesn't do arithmetic, at least not directly. Cry

Are you ready for some medium duty javascript programming, replete with document.write statements and such? :o [lol] That is something that Proxo can handle for you. [smoke]


Oddysey
[smoke]

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
May. 17, 2005, 05:39 PM
Post: #3
 
Sure Prox can do math. Smile! Look here.

sidki
Add Thank You Quote this message in a reply
May. 17, 2005, 06:30 PM
Post: #4
 
sidki3003 Wrote:Sure Prox can do math. Smile!&nbsp; Look here.

sidki
Ah yes, dear MizzMona...

I've been waitin' for the next release so that I can do division and generate some portfolio-specific filters that calculate ROI and YTD percentages...


I wonder if MizzMona is up to the challenge...
Add Thank You Quote this message in a reply
May. 18, 2005, 07:17 AM
Post: #5
 
sidki;

I must respectfully reserve my judgment of those 'filters'.


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
May. 18, 2005, 03:29 PM
Post: #6
 
hmm, not sure what that means...

i'm currently "embedding" [embedded object with Class ID number assigned to it] a 'small' Excel spreadsheet (only when Ctrl key is pressed) into Yahoo! Finance pages so that I can calculate percentages...

it would be SOOO much easier if 'total.zip' would be able to do division...
Add Thank You Quote this message in a reply
May. 18, 2005, 03:57 PM
Post: #7
 
I remember that adding percentage to Total was on topic a short while back. Maybe a nice email helps. Smile!

sidki
Add Thank You Quote this message in a reply
May. 19, 2005, 08:52 PM
Post: #8
 
ProxRocks;
Quote:hmm, not sure what that means...
Simply that I don't have anything nice to say about that particular way of doing things, so......

But, as per my usual caveat to others (if you aren't part of the solution.....), I do have an alternate suggestion. Why not simply embed, with document.write statements, a short javascript that accomplishes the same thing, is much more intuitive, is both maintainable and expandable (division, anyone?), and is the proper domain of doing things arithmetical or mathematical? As we've dicussed before, why reinvent the wheel, only to make it do something that can be done easier by some other method? (I believe you were the very person who pounded that into our heads, PR.)

Just trying to be tactful, and hopefully succeeding. No Expression


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
May. 19, 2005, 09:25 PM
Post: #9
 
<font type = sarcasm>
me? pound?
</font>

I know nil to nothing of javascript and doc.write...

If you or anyone knows of a javascript method to take two numbers obtained from HTML incoming text and perform a division on said text, then I'm ALL ears...


<side note>
Heads will roll!

Heads don't roll, they bounce...
It's the ears, they get in the way...
</side note>
Add Thank You Quote this message in a reply
May. 19, 2005, 09:37 PM
Post: #10
 
hmm, after a few Google searches...

http://www.functionx.com/javascript/Lesson04.htm

Division is second to the bottom...
Something tells me that it cannot be that easy...

I'll experiment over the weekend...


edit: do let me be so kind as to point out that mizz_mona's subroutine is to give PROXOMITRON the ability to add, subtract, and multiply... the addition and subtraction is EXTREMELY useful from a Proxo point of view... granted, MY wanting to generate PERCENTAGES is an issue that does not NEED to be divided by Proxo... Proxo can simply be used to 'tweak' the incoming HTML and rewrite it so that the BROWSER performs the division, not Proxo... but if you want/need Proxo to add or subtract, then you NEED mizz_mona's AWESOME subroutine... if you want your BROWSER to add or subtract, then yes, there are other means...
Add Thank You Quote this message in a reply
May. 20, 2005, 07:06 AM
Post: #11
 
ProxRocks;
Quote:....but if you want/need Proxo to add or subtract, then you NEED mizz_mona's AWESOME subroutine...
Granted.

I'm just very narrow-minded and highly unimaginative in that I don't foresee a need for such capability. Sorry to have to ruin anyone's day for having shown my troglodytishness. [unsure]

You do realize that there are more characters in her routine than in all of my filters put together, don't you? And that's even after discounting her comments! The KISS principle strikes again. B)


Oddysey

I'm no longer in the rat race - the rats won't have me!
Add Thank You Quote this message in a reply
May. 20, 2005, 08:41 AM
Post: #12
 
Regarding real arithmetical operations, i'd tend to use JavaScript as well.
(ProxRocks, if you just want to grab a few numbers from the code, do some math with them, and print the result, then it could be easy to do, maybe we can discuss this in another thread.)

However, when it comes to incrementing/decrementing - which was the original question, there isn't a simpler and faster way than using a Proxomitron list.

There's a bunch of situations where this can be useful in a filter, i use it massively when i have to make sure that a nested tag structure gets closed at the bottom of a document.

There was a discussion on this board the other day about optimizing a certain "count list". No, we weren't talking about apples and oranges. Smile!

sidki
Add Thank You Quote this message in a reply
May. 20, 2005, 09:46 AM
Post: #13
 
Speaking of the original question, the filter match would look like...
Code:
([0-9])\1$TST((\1+)=$LST(Count)|*)$SET(t=$GET(i))$ALERT($GET(t))
...when using this list.

sidki
Add Thank You Quote this message in a reply
May. 20, 2005, 11:18 AM
Post: #14
 
i'm plannin' on seein' if i can implement a javascript doc.write over the wknd and see if i can do a divide...

if i run into a snag, i'll start a new thread with whatever i end up with 'for starters'...


as the saying goes, there's more than one way to skin a cat...
i'll admit that multiplication and division is best performed by jscript...
but am also of the mind that addition and subtraction is all but a Proxo requirement...
Add Thank You Quote this message in a reply
May. 20, 2005, 08:01 PM
Post: #15
 
as a follow up, that document.write is CAKE...
wish I would have stumbled into that a looonng time ago...


edit: now if I can only limit the quotient to a few decimal places instead of the SIXTEEN decimal places that are returned... lol...
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: