Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline RFreund  
#1 Posted : 07 March 2017 00:01:32(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
Location: IL

Was thanked: 19 time(s) in 17 post(s)
Why is it that within an if statement I can use a Boolean equal sign to compare objects to a number, but if I try to compare numbers to text I get an error stating that the action could not be performed with text.

See attached.

Boolean Operator - Text and Number.sm (10kb) downloaded 31 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 07 March 2017 04:51:13(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Not sure what you are looking for ?

IsString.BMP
Offline RFreund  
#3 Posted : 07 March 2017 05:26:04(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
Location: IL

Was thanked: 19 time(s) in 17 post(s)
Ah yes, I should have been more specific.

It seems odd to me that the if you compare text to a number the Boolean decides that the text does not equal the number so it executes "as expected". However, if you compare a number to text there is an error thrown. Clearly the text is not the number so why not behave in the same manor?

Thanks for the response, btw.
Offline Davide Carpi  
#4 Posted : 07 March 2017 13:01:20(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Seems a bug to me. At first glance it happens only if the number in the comparison comes from el() and is not the first matrix element.

Edited by user 26 May 2017 15:53:08(UTC)  | Reason: marked as FIXED

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Jean Giraud  
#5 Posted : 07 March 2017 14:42:04(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Few modules in this work sheet, may be useful.
Sorry : unrecorded source/originator.

Jean

Utilities Matrix IsArray.sm (21kb) downloaded 21 time(s).
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.