- Hi Jim,

> I get an error message on this clip I copied from the help

Try this one from the Utilities Library:

>

> ^$[(^?[Fahrenheit]-32)*(5/9)]°C=^?[Fahrenheit]°F

>

> [error in expression]°C=89°F

H=Fahrenheit -> Centigrade

^!Prompt ^?[Temperature in Fahrenheit]°F = ^$Calc(((^?[Temperature in Fahrenheit])-32)*(5/9))$°C

Happy Clip'n!

Jody

http://www.sureword.com/notetab

Subscribe, UnSubscribe, Options

mailto:Ntb-Clips-Subscribe@...

mailto:Ntb-Clips-UnSubscribe@...

http://www.egroups.com/group/ntb-clips - Hi Jim,

>I get an error message on this clip I copied from the help

I think "^?[...]" qualifies as a function. And the old ^$[

>

>^$[(^?[Fahrenheit]-32)*(5/9)]°C=^?[Fahrenheit]°F

>

> [error in expression]°C=89°F

will no longer work with functions. You need to use the function

^$Calc(expression)$ instead.

Jody already gave you one formula, but here is another --

my favorite, 'cause you only need a single clip to convert

both ways (F-->C & C-->F).

Only two lines -- one input, one output:

H="ToFromCelsius"

;long line (one of two lines, total)

^!SetArray %Switch%=^?{Number degrees?};^?{F or C?==_F^=°F;5/9;°C|C^=°C;9/5;°F}

;long line

^!Info ^%Switch1%^%Switch2% = ^$Calc((^%Switch1%+40)*^%Switch3%-40)$^%Switch4%

Cheers,

Eb - Thanks, Eb.

Your solution works too so I'm happy.

However, the help file needs changing to fix the error. Does Jody do that

or who?

Jim

> Hi Jim

C?==_F^=°F;5/9;°C|C^=°C;9/5;°F}

>>I get an error message on this clip I copied from the help

> >^$[(^?[Fahrenheit]-32)*(5/9)]°C=^?[Fahrenheit]°F

> > [error in expression]°C=89°F

> I think "^?[...]" qualifies as a function. And the old ^$[

> will no longer work with functions. You need to use the function

> ^$Calc(expression)$ instead.

>

> Jody already gave you one formula, but here is another --

> my favorite, 'cause you only need a single clip to convert

> both ways (F-->C & C-->F).

> Only two lines -- one input, one output:

>

> H="ToFromCelsius"

> ;long line (one of two lines, total)

> ^!SetArray %Switch%=^?{Number degrees?};^?{F or

> ;long line

^$Calc((^%Switch1%+40)*^%Switch3%-40)$^%Switch4%

> ^!Info ^%Switch1%^%Switch2% =

>

> Cheers, Eb

> - Hi Jim,

> However, the help file needs changing to fix the error. Does

Eric is aware of it now - you may have missed my post telling how

> Jody do that or who?

to report things and that I would take care of it. It should

have worked as is, but obviously not. <g> Thanks!

Old syntax prior to NoteTab 4.51:

Note that since NoteTab 4.8, the old format will not work if the

expression is built from the values of variables and functions.

You should use the ^$Calc(Expression[;Decimals])$ function

instead.

Happy Clip'n!

Jody

http://www.sureword.com/notetab

Subscribe, UnSubscribe, Options

mailto:Ntb-Clips-Subscribe@...

mailto:Ntb-Clips-UnSubscribe@...

http://www.egroups.com/group/ntb-clips - At 01:06 PM 8/5/2000 -0400, Eb Guenther wrote:

>H="ToFromCelsius"

First let me say, I think that is a real Neat little clip, but I think it needs to be de-mystified a bit, for the less experienced.

>;long line (one of two lines, total)

>^!SetArray %Switch%=^?{Number degrees?};^?{F or C?==_F^=°F;5/9;°C|C^=°C;9/5;°F}

>;long line

>^!Info ^%Switch1%^%Switch2% = ^$Calc((^%Switch1%+40)*^%Switch3%-40)$^%Switch4%

The ^!SetArray %Switch%=... creates a 4 element array containing either:

Element 1 - nn degrees (or) nn degrees

Element 2 - °F °C

Element 3 - 5/9 9/5

Element 4 - °C °F

dependent on the selection in the clip wizard.

The ^!Info statement uses the ^%Switchn% syntax where n = the element number:

(^%Switch1%^%Switch2% = ^$Calc((^%Switch1%+40)*^%Switch3%-40)$^%Switch4%)

nn°F = ^$Calc((nn+40)*5/9-40)$°C

(or) nn°C = ^$Calc((nn+40)*9/5-40)$°F

I hope this helps some of you understand this more clearly.

Charlie.

Charles M. Raine Home Page: http://www.escape.ca/~rainec

Phone (204) 895-0940 ICQ # 300058

Winnipeg, Manitoba, Canada