Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Sun Nov 19, 2017 7:03 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Nov 09, 2011 5:38 pm 
Offline

Joined: Thu Aug 09, 2007 4:44 pm
Posts: 67
I want to use 'Find' to search an array of booleans for the first false value. If I write:

find (array[6],1,5,false)

I get an incompatible types error, unable to promote scalar boolean to any type of array.

I'm sure I'm formatting it wrong somehow. Any tips?

Thanks


Top
 Profile  
 
PostPosted: Thu Nov 10, 2011 7:33 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Find is used to find smaller arrays within a larger one (e.g. substring search). Typically I just create a dummy one element array when I need to find a scalar within an array

Code:
dim tmpArr[1] as boolean
tmpArr[0] := false
find (array[6],1,5,tmpArr)

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
PostPosted: Thu Nov 10, 2011 12:20 pm 
Offline

Joined: Thu Aug 09, 2007 4:44 pm
Posts: 67
Thanks Jeremy, that worked well. Will the same method work for finding an integer in an array of integers?

Aaron


Top
 Profile  
 
PostPosted: Thu Nov 10, 2011 12:25 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Yes, it should work for arrays of any type.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group