Screenshots     Download     Documentation     Tutorials     Partners     Resources     Contact     Forum     Search  

 
<<Prev 1 2 3 4 5 6 7 Next>>

VBScript

Each recognized shape now represents a single digit. We need to use the shape information to create a single "temperature" variable that contains the final number. We do this by using the VBScript module to combine the information produced by the Shape_Match module in the SHAPE array.
' get a reference to the shapes array information 
' that was created by the shape_match module
shapes GetArrayVariable("SHAPES")
names 
GetStrVariable("SHAPES_PATH")

' temp will hold the final temperature number
temp ""

if isArray(shapes) then
  
' be sure we have found enough digits
  
if ubound(shapes) >26 then
    
' step through all objects and merge
    ' the number they represent
    
for i=to ubound(shapes)-step 9

        
nstart1 shapes(i+7)
        temp 
temp &  mid(names, nstart1+1, 1)
        
' we artificially put back in the period
        ' as we know where it should be
        
if then
          
temp temp &  "."
        
end if

    next

    
' and finally create a variable that represents
    ' the text that we see. Note that this only
    ' gets set when enough digits are recognized
    
setvariable "temperature", temp

  
end if
end if

On executing this script a new variable "temperature" is produced that contains the recognized temperature digits.

<<Prev 1 2 3 4 5 6 7 Next>>

© 2008 RoboRealm. All Rights Reserved. | Contact | Glossary | Privacy | Disclaimer | Link to Us | Resources | Site Map