Type control
|
03-13-2015, 06:14 PM
Post: #22
|
|||
|
|||
RE: Type control
(03-13-2015 03:18 PM)salvomic Wrote:(03-13-2015 03:04 PM)Han Wrote: Ensure there are no conflicts between the CAS version of myprog and the non-CAS version of myprog. In other words, name them differently to make sure that when you type myprog you aren't running the wrong program (since different programs can actually have the same name). As for the error (w/ respect to the second code block in your post), it is being generated much further inside your program. What you have posted there does not produce any errors. You need to use CASE and not separate IF statements. Suppose a is not a number object. Without using CASE, then your program will reach the third IF statement. However, the check IF (a<=0 OR a>=1) would not make sense and this is the cause of your error, since the <= and >= operators may not properly return the correct result to be used by the OR command. For example, try: {1,2} >= {0,5} and you will see {1,0} {1,0} OR {0,0} and the result is {1,0} However, an IF statement does not know what to do with a list -- IF ({1,0}) makes no sense. To avoid this, you need to use CASE blocks surrounding your IF statements so that a list input in captured by only one IF statement and then program control is passed to the point beyond the end of the CASE block (i.e. skips all other IF tests). Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Type control - salvomic - 02-22-2015, 03:42 PM
RE: Type control - Han - 02-22-2015, 04:37 PM
RE: Type control - salvomic - 02-22-2015, 04:46 PM
RE: Type control - Joe Horn - 02-22-2015, 08:47 PM
RE: Type control - salvomic - 02-22-2015, 08:52 PM
RE: Type control - Joe Horn - 02-23-2015, 04:17 AM
RE: Type control - salvomic - 02-23-2015, 08:31 AM
RE: Type control - toml_12953 - 02-23-2015, 04:52 PM
RE: Type control - salvomic - 02-23-2015, 05:01 PM
RE: Type control - Joe Horn - 02-23-2015, 11:40 PM
RE: Type control - salvomic - 02-23-2015, 04:51 PM
RE: Type control - Han - 02-23-2015, 05:10 PM
RE: Type control - salvomic - 02-23-2015, 05:40 PM
RE: Type control - Han - 02-23-2015, 07:18 PM
RE: Type control - salvomic - 02-23-2015, 07:29 PM
RE: Type control - salvomic - 03-12-2015, 09:59 AM
RE: Type control - Han - 03-13-2015, 03:04 PM
RE: Type control - salvomic - 03-13-2015, 03:18 PM
RE: Type control - Han - 03-13-2015 06:14 PM
RE: Type control - salvomic - 03-13-2015, 06:29 PM
RE: Type control - Han - 03-13-2015, 06:34 PM
RE: Type control - salvomic - 03-13-2015, 06:44 PM
RE: Type control - salvomic - 03-13-2015, 10:39 PM
RE: Type control - Han - 03-14-2015, 09:49 AM
RE: Type control - salvomic - 03-14-2015, 10:00 AM
RE: Type control - Angus - 02-24-2015, 06:28 AM
RE: Type control - salvomic - 02-24-2015, 06:34 AM
RE: Type control - Joe Horn - 02-25-2015, 05:52 AM
|
User(s) browsing this thread: 3 Guest(s)