Post Reply 
Need to convert FIF49 to Prime version
06-22-2018, 01:07 PM
Post: #15
RE: Need to convert FIF49 to Prime version
It is possible to customize soft keys. This is done through the DRAWMENU command and use the MOUSE keys.

On the link here I have two programs that uses soft menus: https://edspi31415.blogspot.com/2014/04/...grams.html

Also here is an updated FTIN: I corrected a spelling error and re-labeled on the of the options. .
Code:

sub1();
sub2();


EXPORT FTIN()
BEGIN
// 2018-06-21 EWS

// initialization
LOCAL fx,fy,fz,ch;
LOCAL lx,ly,lz,Y,S;
LOCAL aflag,str,dh;

INPUT({{Y,
{2,4,8,16,32,64}}},
"ACCURACY DESIRED","/");
Y:=2^Y;

// initial entry
CHOOSE(dh,"Initial Units",
{"ft-in","ft^2"});
IF dh==1 THEN
fx:=sub1();
fz:=fx;
aflag:=0;
ELSE
INPUT(fx,"Enter Area","ft^2:");
fz:=fx;
aflag:=1;
END;

WHILE ch≠9 DO
fx:=fz;

// string for fz
IF aflag==0 THEN
lx:=sub2(fx,Y);
str:=STRING(lx(1))+" ft "+
STRING(lx(2))+" "+
STRING(lx(3))+" in";
ELSE
str:=STRING(fx)+" ft^2";
END;


CHOOSE(ch,str,
{"Add ft-in",
"Subtract ft-in",
"Multiply by scalar",
"Divide by scalar",
"Multiply to area",
"Divide from area",
"Square Root from area",
"Change accuracy settings",
"Quit"});


// add ft-in
IF ch==1 THEN
fy:=sub1();
fz:=fx+fy;
lx:=sub2(fx,Y);
ly:=sub2(fy,Y);
lz:=sub2(fz,Y);

PRINT();
PRINT(lx(1)+" ft "+lx(2)+
" "+lx(3)+" in");
PRINT("+");
PRINT(ly(1)+" ft "+ly(2)+
" "+ly(3)+" in");
PRINT("=");
PRINT(lz(1)+" ft "+lz(2)+
" "+lz(3)+" in");

WAIT(0);
END;

// subtract ft-in
IF ch==2 THEN
fy:=sub1();
fz:=fx-fy;
lx:=sub2(fx,Y);
ly:=sub2(fy,Y);
lz:=sub2(fz,Y);

PRINT();
PRINT(lx(1)+" ft "+lx(2)+
" "+lx(3)+" in");
PRINT("-");
PRINT(ly(1)+" ft "+ly(2)+
" "+ly(3)+" in");
PRINT("=");
PRINT(lz(1)+" ft "+lz(2)+
" "+lz(3)+" in");
WAIT(0);
END;

// multiply by scalar
IF ch==3 THEN
INPUT(S,"Enter Scalar");
fz:=fx*S;
lx:=sub2(fx,Y);
lz:=sub2(fz,Y);

PRINT();
PRINT(lx(1)+" ft "+lx(2)+
" "+lx(3)+" in");
PRINT("*");
PRINT(S);
PRINT("=");
PRINT(lz(1)+" ft "+lz(2)+
" "+lz(3)+" in");
WAIT(0);
END;

// divide by scalar
IF ch==4 THEN
INPUT(S,"Enter Scalar");
fz:=fx/S;
lx:=sub2(fx,Y);
lz:=sub2(fz,Y);

PRINT();
PRINT(lx(1)+" ft "+lx(2)+
" "+lx(3)+" in");
PRINT("/");
PRINT(S);
PRINT("=");
PRINT(lz(1)+" ft "+lz(2)+
" "+lz(3)+" in");
WAIT(0);
END;

// multiply to area
IF ch==5 THEN

fy:=sub1();
fz:=fx*fy;
fz:=ROUND(fz,6);
lx:=sub2(fx,Y);
ly:=sub2(fy,Y);
aflag:=1;

PRINT();
PRINT(lx(1)+" ft "+lx(2)+
" "+lx(3)+" in");
PRINT("*");
PRINT(ly(1)+" ft "+ly(2)+
" "+ly(3)+" in");
PRINT("=");
PRINT(fz+" ft^2");
WAIT(0);
END;

// divide from area
IF ch==6 THEN

fy:=sub1();
fz:=fx/fy;
ly:=sub2(fy,Y);
lz:=sub2(fz,Y);
aflag:=0;

PRINT();
PRINT(fx+" ft^2");
PRINT("/");
PRINT(ly(1)+" ft "+ly(2)+
" "+ly(3)+" in");
PRINT("=");
PRINT(lz(1)+" ft "+lz(2)+
" "+lz(3)+" in");
WAIT(0);
END;

// square root from area
IF ch==7 THEN
fz:=√(fx);
lz:=sub2(fz,Y);
aflag:=0;

PRINT();
PRINT("√"+fx+" ft^2");
PRINT("=");
PRINT(lz(1)+" ft "+lz(2)+
" "+lz(3)+" in");
WAIT(0);
END;

// change accruacy settings
IF ch==8 THEN
INPUT({{Y,
{2,4,8,16,32,64}}},
"ACCURACY DESIRED","/");
Y:=2^Y;
END;

END;

END;


// feet-inch-fraction entry
sub1()
BEGIN
LOCAL f,i,s,n;
INPUT({f,i,s,{n,
{2,4,8,16,32,64}}},
"ENTRY",
{"Feet: ","Inch: ",
"Frac: ","/"});
RETURN f+(i+s/(2^n))/12;
END;

// convert to feet-inch
sub2(x,y)
BEGIN
LOCAL f,i,s,t;
f:=IP(x);
i:=IP(FP(x)*12);
s:=ROUND(FP(FP(x)*12)*y,0);
t:=QPI(s/y);
RETURN {f,i,t};
END;
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Need to convert FIF49 to Prime version - Eddie W. Shore - 06-22-2018 01:07 PM



User(s) browsing this thread: 2 Guest(s)