Re: curious behavior...

2004-06-02 Thread tuviah snyder
NumberFormat is a local property, not global, like the itemdelimiter. The do
command has it's own context.

Tuviah


- Original Message -
From: "Chipp Walters" <[EMAIL PROTECTED]>
To: "Use-Revolution" <[EMAIL PROTECTED]>; "tuviah snyder"
<[EMAIL PROTECTED]>
Sent: Friday, May 28, 2004 8:19 AM
Subject: curious behavior...


> I'm trying to programatically set the numberFormat property.
>
> on mouseUp
>repeat 4 times
>  put "#" after t
>end repeat
>put "set the numberFormat to " "e& t "e into tDo
>do tDo
>put 5+1
> end mouseUp
>
> puts just "6" in the msg
>
> now if I try:
>
> on mouseUp
>set the numberFormat to ""
>put 5+1
> end mouseUp
>
> It puts the expected "0006"
>
> Any ideas why??
>

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: curious behavior...

2004-05-29 Thread jcwall
Dear Jan,

Thanks for the tip.  It is certainly a lot simpler and far more elegant than my 
solution.  I wonder how you would deal with a script that includes a repeat loop that 
does something like the following:

put 1 into i
  repeat 3
put "ETGUG" & i into x
put x into fld i of cd "Results"
add 1 to i
  end repeat

I will play with this and see what I come up with.

Jim Wall

> Hi Jim,
> 
> I usually do all calculations before applying any
> formatting ; and then I use the format() function ; in
> this case :
> --
>  put 1 into i
>  repeat 3
>put "ETGUG" & i into x
>add fld x to tAnswer
>add 1 to i
>  end repeat
>  put format(tAnswer,"%.2f") into field "Answer"
> --
> 
> Hope this helped,
> 
> Jan Schenkel.
> 
> =
> "As we grow older, we grow both wiser and more foolish at the same 
> time."  (La Rochefoucauld)
> 
> 
>   
>   
> __
> Do you Yahoo!?
> Friends.  Fun.  Try the all-new Yahoo! Messenger.
> http://me
ssenger.yahoo.com/ 
> ___
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: curious behavior...

2004-05-29 Thread Jan Schenkel
--- [EMAIL PROTECTED] wrote:
> Slightly off topic but to do with numberFormat.
> 
> I have had some difficulties with this property
> which I have managed to get around.  I needed to do
> some calculations and enter the result in a field
> limiting the number to two decimal places.  Set the
> numberFormat to "0.00" works as documented.  My
> difficulty came when I needed to do calculations
> within a repeat loop e.g.
> 
> set the numberFormat to "0.00"
> put 1 into i
> repeat 3
> put "ETGUG" & i into x
> add fld x to fld "Answer"
> add 1 to i
> end repeat
> 
> Because of the numberFormat instead of x being
> ETGUG1 as I had hoped because that is the name of
> the field thet I wanted, it becomes ETGUG1.00 and
> since there is no field ETGUG1.00 the script fails. 
> As I said, I have managed to solve the problem by
> constantly changing the numberFormat property so
> this is not a pressing issue.  However, it was messy
> and I thought that if it were possible to set the
> number format of the field this would simplify the
> process.  I tried set the numberForma
> t of fld "ETGUG1" but, as documented, this does not
> work.  Does anyone know if there is some way to
> accomplish this?
> 
> Jim Wall
> 

Hi Jim,

I usually do all calculations before applying any
formatting ; and then I use the format() function ; in
this case :
--
  put 1 into i
  repeat 3
put "ETGUG" & i into x
add fld x to tAnswer
add 1 to i
  end repeat
  put format(tAnswer,"%.2f") into field "Answer"
--

Hope this helped,

Jan Schenkel.

=
"As we grow older, we grow both wiser and more foolish at the same time."  (La 
Rochefoucauld)




__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: curious behavior...

2004-05-29 Thread jcwall
Slightly off topic but to do with numberFormat.

I have had some difficulties with this property which I have managed to get around.  I 
needed to do some calculations and enter the result in a field limiting the number to 
two decimal places.  Set the numberFormat to "0.00" works as documented.  My 
difficulty came when I needed to do calculations within a repeat loop e.g.

set the numberFormat to "0.00"
put 1 into i
repeat 3
put "ETGUG" & i into x
add fld x to fld "Answer"
add 1 to i
end repeat

Because of the numberFormat instead of x being ETGUG1 as I had hoped because that is 
the name of the field thet I wanted, it becomes ETGUG1.00 and since there is no field 
ETGUG1.00 the script fails.  As I said, I have managed to solve the problem by 
constantly changing the numberFormat property so this is not a pressing issue.  
However, it was messy and I thought that if it were possible to set the number format 
of the field this would simplify the process.  I tried set the numberForma
t of fld "ETGUG1" but, as documented, this does not work.  Does anyone know if there 
is some way to accomplish this?

Jim Wall

- Original Message -
From: Chipp Walters <[EMAIL PROTECTED]>
Date: Friday, May 28, 2004 3:19 pm
Subject: curious behavior...

> I'm trying to programatically set the numberFormat property.
> 
> on mouseUp
>   repeat 4 times
> put "#" after t
>   end repeat
>   put "set the numberFormat to " "e& t "e into tDo
>   do tDo
>   put 5+1
> end mouseUp
> 
> puts just "6" in the msg
> 
> now if I try:
> 
> on mouseUp
>   set the numberFormat to ""
>   put 5+1
> end mouseUp
> 
> It puts the expected "0006"
> 
> Any ideas why??
> 
> 
> ___
> use-revolution mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution