Post Reply 
An HP71 does not like F as a variable
12-12-2023, 08:27 AM
Post: #6
RE: An HP71 does not like F as a variable
(12-12-2023 05:35 AM)Paul Dale Wrote:  The error message could definitely be more informative.

I agree, for beginners. But once you know it, it's clear: one or both parts of the assign operation are not of the right types.
The error message could be "Not Scalar Type", but I'm not sure it would help beginners so much.

Quote:Likewise, why shouldn't the assignment just work?

Well no. In classic BASIC, you can assign a scalar value to an entire array only with:
MAT F=(2)

However, you can directly do, Z being a COMPLEX type variable:
Z=2
instead of an explicit Z=(2,0)
because the complex type is considered as a scalar type (in opposition to arrays) so implicit real to complex type conversion is possible.
The opposite (complex to real conversion) is not possible : -> Data Type error.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: An HP71 does not like F as a variable - J-F Garnier - 12-12-2023 08:27 AM



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