Okay.. been working with this for about an hour now and can't seem to get the correct results.

I thought it would be an easy task to do, but I'm having trouble understanding how it works I guess. Can someone point me in the right direction as to what or where I'm going wrong.

I was trying to create a simple OHMS/POWER Calculator... [Frown]

I'm using KiXtart 2001 4.10 Release Candidate 2

code:
; $v=Voltage $i=Current $r=Resistance
$v=FormatNumber("25,4")
$i=FormatNumber("2,4")
$r=FormatNumber($v,4/$i,4)
? "Voltage is: " FormatNumber($v,4)
? "Current is: " FormatNumber($i,4)
? "Resistance is: " FormatNumber($r,4) + " Ohms "

; Result = 25.0000 which is the wrong value


$v=VAL(25)
$i=VAL(2)
$r=val($v/$i)
? "Voltage is: " val($v)
? "Current is: " val($i)
? "Resistance is: " val($r) + " Ohms "

; Result = 12 which is the wrong value

Power (P), expressed in WATTS P = E*R P = E^2/R P = I^2*R
Voltage (E), expressed in VOLTS V = P/I V = I*R V = Sq root of (P*R)
Current (I), expressed in AMPERES I = E/R I = P/E I = Sq root of (P/R)
Resistance (R), expressed in OHMS R = E^2/P R = P/I^2 R = E/I

[ 13 June 2002, 10:57: Message edited by: NTDOC ]