help programming
03-22-2014, 05:43 PM (This post was last modified: 03-22-2014 05:44 PM by Arcturus314.)
Post: #1
 Arcturus314 Junior Member Posts: 17 Joined: Mar 2014
help programming
So I wrote a program that is giving me a syntax error:

EXPORT PROG1(A,B,C)
BEGIN
LOCAL D=0;
LOCAL E=0;
(-B+SQUAREROOT(B^2-4AC))/(2A)->D;
(-B-SQUAREROOT(B^2-4AC))/(2A)->E;
MSGBOX(D,E);
END;

squareroot is replaced by the square root symbol in the code
So what is the problem?
03-22-2014, 05:49 PM
Post: #2
 Han Senior Member Posts: 1,842 Joined: Dec 2013
RE: help programming
(03-22-2014 05:43 PM)Arcturus314 Wrote:  So I wrote a program that is giving me a syntax error:

EXPORT PROG1(A,B,C)
BEGIN
LOCAL D=0;
LOCAL E=0;
(-B+SQUAREROOT(B^2-4AC))/(2A)->D;
(-B-SQUAREROOT(B^2-4AC))/(2A)->E;
MSGBOX(D,E);
END;

squareroot is replaced by the square root symbol in the code
So what is the problem?

I presume that -> is the actual store arrow. The problem (based solely on your source code) is that MSGBOX() only takes a single argument. You've separated D and E as two arguments and there is no such instance of MSGBOX() using two arguments. Instead, try: MSGBOX({D,E}).

Graph 3D | QPI | SolveSys
03-22-2014, 05:51 PM
Post: #3
 Ben Fairbank Junior Member Posts: 17 Joined: Mar 2014
RE: help programming
Have you tried putting a multiplication symbol (*) between the 4 and the A and the A and the C, and the 2 and he A?

BAF

(03-22-2014 05:43 PM)Arcturus314 Wrote:  So I wrote a program that is giving me a syntax error:

EXPORT PROG1(A,B,C)
BEGIN
LOCAL D=0;
LOCAL E=0;
(-B+SQUAREROOT(B^2-4AC))/(2A)->D;
(-B-SQUAREROOT(B^2-4AC))/(2A)->E;
MSGBOX(D,E);
END;

squareroot is replaced by the square root symbol in the code
So what is the problem?
03-22-2014, 05:51 PM (This post was last modified: 03-22-2014 05:55 PM by Arcturus314.)
Post: #4
 Arcturus314 Junior Member Posts: 17 Joined: Mar 2014
RE: help programming
Thank you, that fixed it! I didn't know that msgbox only accepted 1 argument. I also assumed it would multiply variables automatically.
03-22-2014, 06:13 PM
Post: #5
 Tim Wessman Senior Member Posts: 2,239 Joined: Dec 2013
RE: help programming
When you press the "CHECK" button, where did the cursor go? My guess is it put it right on the message box.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
03-22-2014, 06:25 PM
Post: #6
 Arcturus314 Junior Member Posts: 17 Joined: Mar 2014
RE: help programming
(03-22-2014 06:13 PM)Tim Wessman Wrote:  When you press the "CHECK" button, where did the cursor go? My guess is it put it right on the message box.

Yep. Just tested it.
 « Next Oldest | Next Newest »

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