%%HP: T(1)A(D)F(.);

  IF
"Linear break-even analysis"
{ { "Con.: "
"Enter the constant costs."
0 } { "Var.: "
"Enter the costs per product."
0 } { "Price: "
"Enter the products price."
0 } { "Cur.:"
"Enter the used currency."
2 } } { 1 5 } { 0 0
0 "dollars" } { 0 0
0 "dollars" }
INFORM
  THEN OBJ DROP 
c v p m
    
      CASE 'p-v==0'
        THEN
"The price and the variable costs cant be equal."
MSGBOX
        END 'c0'
        THEN
"The constant costs must be positive."
MSGBOX
        END 'v0'
        THEN
"The variable costs must be positive."
MSGBOX
        END 'p0'
        THEN
"The price must be positive."
MSGBOX
        END 'v>p'
        THEN
"A price lower than the pro- ducts costs makes no sense."
MSGBOX
        END RCLF {
PPAR PICT } PURGE '
c/(p-v)' EVAL DUP
100 / CEIL 100 *
DUP -.5 * IP SWAP 2
* IP XRNG 'c/(p-v)*
p' EVAL DUP 100 /
CEIL 100 * DUP -.25
* IP SWAP 1.5 * IP
YRNG 'n' 0 'c/(p-v)
*2' EVAL 3 LIST
INDEP # Ah RES {
"Quantity" "Money"
} AXES { # 0h # 0h
} PVIEW DRAX LABEL
-28 SF -31 CF { 'v*
n+c' 'p*n' } STEQ
DRAW 'EQ' PURGE -31
CF  x y
         x y RC 0
y RC LINE x y RC
x 0 RC LINE STOF
"Break-even at " x
0 RND STR
" products (or " y
2 RND STR "
" m
")." + + + + + +
MSGBOX x 0 RND
"Break-even" TAG
        
      END { # 0h
# 0h } PVIEW 7
FREEZE
    
  END { PPAR }
PURGE

