New to the site and glad to be here....I am not as skilled as all of you and i guess thats why im here for some help. I have just bought a hp prime and am having trouble in programming like im used to on the prizm or a ti 86. Here is an example program below that im used to doing which the prime does not offer lbl's or goto commands....so if someone can give me an example on how to write this on the prime would be greatly appreciated.... 'ProgramMode:RUN
"REVCHORD OR REGCHORD OR DIAMETER UNKNOWN?"
"(REV=0)(REG=1) (DIA.UNKNOWN=2)"?->Y
ClrText
Y=0=>Goto 0
Y=1=>Goto 1
Y=2=>Goto 2
Lbl 0
ClrText
"CHORD="?->A
"RADIUS="?->R
cos^-1 ((R^<2>+R^<2>-A^<2>)/(2(R*R)))->P
"DEGREE OF CHORD IS"
PDispsAns>DMSDispsClrText
Stop
Lbl 1
"NUMBER OF HOLES"?->H
"BOLT CIRCLE DIA"?->D
D*sin ((360/H)/2)->S
ClrText
"LENGTH OF CHORD"
SDispsAns>DMSDispsClrText
Stop
Lbl 2
"KNOWN CHORD"?->C
"NUMBER OF HOLES"?->N
C/sin ((360/N)/2)->D
"DIAMETER IS"
D
The Prime supports local functions within programs, so you can call functions based on the input.
I thank you for the reply but if you could give me an example to look at that would be great .....like i said im not to good with al the lingo...but can program like i posted above
Here's an example of a Prime program to do what you're doing with gotos (not actually your program):


Code:
CaseA()
BEGIN
PRINT("A");
END;

CaseB()
BEGIN
PRINT("B");
END;

CaseC()
BEGIN
PRINT("C");
END;

EXPORT Testing123()
BEGIN
LOCAL inp;
INPUT(inp, "1, 2, or 3");
CASE
IF inp = 1 THEN CaseA(); END
IF inp = 2 THEN CaseB(); END
IF inp = 3 THEN CaseC(); END
DEFAULT PRINT("None");
END;
END;
Thanks for the help....im very thankful
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement