flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 07 Jun 2025, 06:02
Code: if 1 ~ eq 2 display 'Use 1 ~ eq 2' end if if ~ 1 eq 2 display 'Use ~ 1 eq 2' end if Code: flat assembler version 1.73.31 (16384 kilobytes memory) Use ~ 1 eq 2 1 passes, 0 bytes. |
|||
![]() |
|
Roman 07 Jun 2025, 07:32
Quote: if ~ e eq '0' Weird. But thanks. How I understood symbol ~ mean not. On logic must be Quote: if e ~ eq '0' |
|||
![]() |
|
revolution 07 Jun 2025, 07:42
eq compares tokens.
"1 ~ eq 2" means: "1" "~" == "2". Two tokens "1" and "~" compares to one token "2" "~ 1 eq 2" means: not "1" == "2". Not one token "1" compares to one token "2" |
|||
![]() |
|
Roman 07 Jun 2025, 09:03
Quote: "1 ~ eq 2" means: "1" "~" == "2". Two tokens "1" and "~" compares to one token "2" not work. Code: ee1 = 'do ' ee2 = 'some' if ee1 ee2 eq 'do some' display 'yes!' ;I not get yes! end if define ee1 'do ' define ee2 'some' if ee1 ee2 eq 'do some' ;I not get yes! display 'yes!' end if if ee1 eq 'do ' ;I get yes! display 'yes!' end if if ee1 eq 'do ' & ee2 eq 'some' display 'yes!' ;I get yes! end if if ee1 ~ eq 'do ~' display 'yes!' ;I not get yes! end if if ee1 ~ eq '~' display 'yes!' ;I not get yes! end if Last edited by Roman on 07 Jun 2025, 10:21; edited 1 time in total |
|||
![]() |
|
revolution 07 Jun 2025, 09:43
Appears to be working fine.
What makes you think it isn't working? Note that it doesn't compare strings, it compares tokens. |
|||
![]() |
|
Roman 07 Jun 2025, 10:23
Its work.
Code: define ee1 'do ' define ee2 'some' if ee1 ee2 eq 'do ' 'some' display 'yes!' ;I get yes! end if tokens equ 'do ' 'some' if ee1 ee2 eq tokens display 'yes!' ;I get yes! end if |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.