From 6c5a70019136e8256a37f467d5bafe735392459b Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 22 Oct 2014 11:54:08 -0700 Subject: [PATCH] SCP: Added numeric value comparisons to IF and ASSERT compares. Compare operations will do a literal compare of basic string values unless the all of each string contains numeric data. If numeric data is there then a numeric comparison will be made. For example: If "+1" == "1" echo equal will display equal, while the simple string comparison will be not-equal. --- scp.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index 74c37cab..fde7b5be 100644 --- a/scp.c +++ b/scp.c @@ -1609,7 +1609,11 @@ ASSERT failure have several different actions: "++> - greater than\n" "++GTR - greater than\n" "++>= - greater than or equal\n" - "++GEQ - greater than or equal\n" + "++GEQ - greater than or equal\n\n" + " Comparisons are generic. This means that if both string1 and string2 are\n" + " comprised of all numeric digits, then the strings are converted to numbers\n" + " and a numeric comparison is performed. For example: \"+1\" EQU "1" will be + " true.\n" /***************** 80 character line width template *************************/ #define HLP_EXIT "*Commands Exiting_The_Simulator" "2Exiting The Simulator\n" @@ -3066,6 +3070,24 @@ for (i=1; iaval) || (result == optr->bval)); if (optr->invert) result = !result;