Comparing internal IDs

Faced with a strange issue today.

:global LastID [:toid *1b]
:local testID [:toid *5]

:if ($testID > $LastID) do={
    :set LastID $testID
    :log info "Last ID updated"
}

Tried to compare 2 internal IDs and got this error:
Script Error: cannot compare if array is more than array

I don't even understand the meaning of this message. Am I doing something wrong or it's a bug that should be reported?

2 Likes
[...]
:foreach item in=[find where (((([$id2num $".id"] > $lastLog) and [...]
[...]

I solved the problem myself time ago with $id2num

:local id2num do={:return [:tonum "0x$[:pick $1 1 [:len $1]]"]}

For me is a bug.

Working example:

:global LastID [:toid *1b]
{
    :local testID [:toid *5]
    :local id2num do={:return [:tonum "0x$[:pick $1 1 [:len $1]]"]}

    :if ([$id2num $testID] > [$id2num $LastID]) do={
        :set LastID $testID
        :log info "Last ID updated"
    }
}
1 Like

Yeah, also started doing this via conversions.

Will report to support.

1 Like