no spam | 1 Jul 2007 06:49
Picon
Favicon

Re: Precluding Negative Values [was: Countdown Timer: Days, Hours...]

it seem that ABS is not found ==> verify that yiu use .ABS if it is a script !
an other solution is to use 2 variables  !
*info  expr ( assign("totalsec", date.subseconds(20060101, date.now))/(24*3600) ++ ":" ++
assign("totalsecabs", ifelse(totalsec<0,totalsec *
-1,totalsec))%(24*3600)/3600++":"++totalsecabs%3600/60++":"++totalsecabs%60) 

Hope this help !

----- Original Message ----
From: thricipio <thricipio@...>
To: power-pro@...
Sent: Saturday, June 30, 2007 8:38:13 PM
Subject: [power-pro] Precluding Negative Values [was: Countdown Timer: Days, Hours...]

    
            Doing a little further testing, I realized that as soon as 

<targetdate> rolls into the past, the displayed result will have a [-]

sign prepended to each component.  To solve this, I've incorporated 

ƒ.ABS within ƒ.ASSIGN.  And this works just fine.

Then it occurred to me that it would be better to test the value 

of . . .

date.subseconds( "<targetdate> ",date.now)

. . . and IF it's negative, prepend the resulting expression with a 
(Continue reading)

sgp | 1 Jul 2007 09:30
Picon
Favicon

Re: FYI Error in Doc file re OnError

Sheri wrote:

> Haven't tried multiple keywords, but the choices appear to be mutually
> exclusive, so possibly keyword should also be singular in the
> documented syntax.

I often use exec.onerror("clear none")

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:power-pro-digest@... 
    mailto:power-pro-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    power-pro-unsubscribe@...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
(Continue reading)

thricipio | 1 Jul 2007 12:49
Picon
Favicon

Re: Precluding Negative Values [was: Countdown Timer: Days, Hours...]

--- In power-pro@..., no spam <nospam0123456us <at> ...> wrote:
>
> it seem that ABS is not found ==> verify that yiu use
> .ABS if it is a script ! an other solution is to use 2
> variables  !
> *info  expr ( assign("totalsec", date.subseconds(20060101,
> date.now))/(24*3600) ++ ":" ++ assign("totalsecabs", ifelse
> (totalsec<0,totalsec * -1,totalsec))%
> (24*3600)/3600++":"++totalsecabs%3600/60++":"++
> totalsecabs%60) 
> 
> Hope this help !

Sorry about any confusion with my abbreviations: "ƒ.ABS" is my own 
short form for "the ABS function."  Likewise: "ƒ.ASSIGN," etc.  I 
think you're using the gmane.org mirror site, which apparently 
doesn't translate some extended characters (e.g., ƒ).

Anyway, thanks for the reply... but...  it seems like the above code 
would just accomplish the same end result as simply using ABS within 
the original assign statement... which is *not* what I'm looking for.

But again, thanks for the response.
________
—Thri
¯¯¯¯¯¯¯¯

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

(Continue reading)

brucexs | 1 Jul 2007 13:26
Picon
Favicon

Re: Precluding Negative Values [was: Countdown Timer: Days, Hours...]

> However, when I code & test this, it doesn't work; i.e., the 
> resulting *info bar seems to contain the entire code text.  I can't 
> figure out why it's failing.
> 
> Here's the code in both readable and usable format:
> http://tinyurl.com/3aafgk
>

Its difficult to debug complex expressions in *info, so I would first 
get it working in a script.

If the error message there is still too hard to pin down, try splitting 
the expression into pieces, maybe
locap part1 = 
local part2 = 
local result =
till you isolate the error.

Also note that PowerPro expressions (and statements) cannot be longer 
than abou 512 characters:  you will get cryptic error messages if they 
are.

YOu can rename the variable to shorten.  Or try something like 
calculating and assigning the expression to a variables, if-else just 
to test sign and produce either "-" or "", then ++ rest of expression 
(so you do not have to repeat formatting).

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

(Continue reading)

Sheri | 1 Jul 2007 14:31
Picon

Re: Precluding Negative Values [was: Countdown Timer: Days, Hours...]

--- In power-pro@..., "brucexs" <bswitzer <at> ...> wrote:
>
> 
> Also note that PowerPro expressions (and statements) cannot be longer 
> than abou 512 characters:  you will get cryptic error messages if they 
> are.

I thought the magic number was 530?

Regards,
Sheri

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:power-pro-digest@... 
    mailto:power-pro-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
(Continue reading)

thricipio | 1 Jul 2007 14:34
Picon
Favicon

Re: Precluding Negative Values [was: Countdown Timer: Days, Hours...]

--- In power-pro@..., "brucexs" <bswitzer <at> ...> wrote:
> You can rename the variable to shorten.  Or try something like 
> calculating and assigning the expression to a variables, if-else just 
> to test sign and produce either "-" or "", then ++ rest of expression 
> (so you do not have to repeat formatting).

Bruce, thanks for the reply.

Just to be clear (clarity for *me*, that is)...

An expression cannot have more than one (however complex) discrete 
statement, right?
________
—Thri
¯¯¯¯¯¯¯¯

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
(Continue reading)

thricipio | 1 Jul 2007 14:41
Picon
Favicon

Expression length [was: Precluding Negative Values]

--- In power-pro@..., "Sheri" <sherip99 <at> ...> wrote:
> I thought the magic number was 530?

Me, I'm still largely clueless about the finer (and not so fine) points 
of using expressions.  But, one might expect 512 to be more likely, 
since it's a power of 2.  But... what do I know?  Astonishingly little 
after all these years as PPro user.
________
—Thri
¯¯¯¯¯¯¯¯

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:power-pro-digest@... 
    mailto:power-pro-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    power-pro-unsubscribe@...
(Continue reading)

thricipio | 1 Jul 2007 18:34
Picon
Favicon

Re: Precluding Negative Values [was: Countdown Timer: Days, Hours...]

--- In power-pro@..., "brucexs" <bswitzer <at> ...> wrote:
> Also note that PowerPro expressions (and statements) cannot be
> longer than abou 512 characters:  you will get cryptic error
> messages if they are.
> 
> You can rename the variable to shorten.  Or try something like 
> calculating and assigning the expression to a variables, if-else
> just to test sign and produce either "-" or "", then ++ rest of
> expression (so you do not have to repeat formatting).

Bruce-

Thanks for the additional tips.  I've gotten this working now.  Turns 
out the problem was the expression's length afterall.  My testing 
yielded failure (with the entire expression string showing up in the 
*info bar) for expression lengths greater than 260.

The results of my efforts, with your help are viewable here:
http://tinyurl.com/289dkm

Thanks again for all the help.
________
—Thri
¯¯¯¯¯¯¯¯

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/
(Continue reading)

brucexs | 1 Jul 2007 18:51
Picon
Favicon

Re: Expression length [was: Precluding Negative Values]

--- In power-pro@..., "thricipio" <thricipio <at> ...> wrote:
>
> --- In power-pro@..., "Sheri" <sherip99 <at> > wrote:
> > I thought the magic number was 530?

Yes, it is around 530; I said 512 to give a safety factor.

An expression is an alternating series of values and operators, grouped 
by balanced parentheses.  See help on expressions for details.

A statement is anything that can stand alone as a script line.

In most languages that still distinguish the two, any expression is 
usually allowable also as a statement, although PowerPro is fussier.  
It permits function or plugin call expressions as statements, but not 
arbitrary expressions.

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

(Continue reading)

thricipio | 1 Jul 2007 18:58
Picon
Favicon

Re: Precluding Negative Values [was: Countdown Timer: Days, Hours...]

--- In power-pro@..., "thricipio" <thricipio <at> ...> wrote:
> An expression cannot have more than one (however complex) discrete 
> statement, right?

A little more effort on my part has shown me that quite a lot can be 
accomplished with the concatenation operand, "++" !  Cool!!
________
—Thri
¯¯¯¯¯¯¯¯

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:power-pro-digest@... 
    mailto:power-pro-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    power-pro-unsubscribe@...

(Continue reading)


Gmane