Welcome Guest
Search
|
Active Topics
|
Log In
|
Register
ERROR
Squirrel - The Programming Language
»
General
»
Bindings
»
comparring arrays
comparring arrays
Options
Previous Topic
Next Topic
comarius
#1
Posted :
Saturday, October 28, 2017 12:21:36 AM(UTC)
Rank: Newbie
Groups: Registered
Joined: 10/10/2017(UTC)
Posts: 5
Location: Toronto
Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hi,
is there a way to compare arrays in script ?
The line below does not complain, does not evaluate ?
if(myobj.getReceivedBuffer() == [0xff,0xfe,0x21])
{
}
Back to top
WWW
User Profile
View Thanks
fagiano
#2
Posted :
Sunday, October 29, 2017 7:31:17 PM(UTC)
Rank: Advanced Member
Groups: Registered, Administrators
Joined: 6/11/2005(UTC)
Posts: 1,062
Thanks: 0 times
Was thanked: 80 time(s) in 62 post(s)
The == operator only checks if they are the same array, it doesn't check if they are a different array with the same content. So if you want to check if 2 arrays have the same content you'll have to check element by element.
Alberto
Follow me on Twitter
@squirrellang
Back to top
User Profile
View Thanks
Users browsing this topic
Guest
Squirrel - The Programming Language
»
General
»
Bindings
»
comparring arrays
Forum Jump
General
- The Language
- Embedding
- Bindings
Development
- Squirrel language review Board
- Squirrel API review Board
- Bugs
Forum
- Stuff
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.
Watch this topic
Email this topic
Print this topic
RSS Feed
Normal
Threaded
Clean Slate theme by Jaben Cargman (
Tiny Gecko
)
Powered by YAF 1.9.4
|
YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.153 seconds.