Re: Comet 32 behavior differences - Another one


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Robert G Laurin on March 04, 2011 at 07:42:43:

In Reply to: Comet 32 behavior differences posted by Robert G Laurin on March 04, 2011 at 07:31:55:

Found another behavior difference...

If I have a single character string with a value of 'Y' or 'N' where the default is 'Y'. By this default, it means that if it is not 'N', then it has to be 'Y'.

So converting this 'Y/N' into a 'Yes' or 'No' I could write an expression like this:

Let Choice$ = Sub('YesNo', Pos(Ch$,'YN') * 3 - 2, 3)

this would covert Y or N but nothing else. I could make it better by using Y as a default:

Let Choice$ = Sub('YesNo', Pos(Ch$,'N') * 3 + 1, 3)

But we get lazy, and I found that in Comet 16, I could actually write it as:

Let Choice$ = Sub('YesNo', Pos(Ch$,'N') * 4, 3) ! That's without the +1

in Comet 16, the sub of something starting at 0 would actually start at 1.
Not so in Comet 32. It returns garbage as first character followed by 'Ye' when Ch$='Y'

I understand that I get lazy, but I think Comet 32 is not validating its parameters properly. Maybe it should start at 1 when 0 is supplied.

Just in case, I fixed this one line already. I hope I didn't do that too often.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?  

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]