[SS-2436] Boolean Operator using Text and Numbers

[SS-2436] Boolean Operator using Text and Numbers - Understanding if statements when using Boolean operators with text and numbers - Сообщения

#1 Опубликовано: 06.03.2017 18:01:32
Ryan Freund

Ryan Freund

19 сообщений из 339 понравились пользователям.

Группа: User

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 (9 КиБ) скачан 71 раз(а).
#2 Опубликовано: 06.03.2017 22:51:13
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Not sure what you are looking for ?

IsString.BMP
#3 Опубликовано: 06.03.2017 23:26:04
Ryan Freund

Ryan Freund

19 сообщений из 339 понравились пользователям.

Группа: User

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.
#4 Опубликовано: 07.03.2017 07:01:20
Davide Carpi

Davide Carpi

1417 сообщений из 2873 понравились пользователям.

Группа: Moderator

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.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#5 Опубликовано: 07.03.2017 08:42:04
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Few modules in this work sheet, may be useful.
Sorry : unrecorded source/originator.

Jean

Utilities Matrix IsArray.sm (20 КиБ) скачан 60 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений