AnsweredAssumed Answered

Function Key Feature or Bug?

Question asked by VRFuser on Mar 16, 1998

from: Stefan Westh / FFV Matteknik AB
stefan.westh@ffvmatteknik.ffv.se/ +46 589 82640/ FAX +46 589 10740
to: Vrf / James Atkin
date: Tuesday, 17 Mars 1998

Hi James!

Maybe this code sample can help you.

Regards S[[ SEARCH~1.VEE : 3638 in SEARCH~1.VEE ]]efan.


  



-----Original Message-----
From: James.Atkin [SMTP:James.Atkin@uk.phase.com]
Sent: Tuesday, March 17, 1998 12:50 PM
To: hpvxd_xc
Subject: VRF-Checking if a number is contained within an array ..

Is there a function to check if a number is part of an array of x  
numbers.
i.e. Is the number 3 contained within an array of 10 integers ?

Thanks

James

(James.Atkin@Phase.Com)
                                                                           
    

                                                                           
    

                                                                           
    

                                                                           
    

                                                                           
    

                                                                           
    

                                             

                                                                           
    

                                                                        


(saveFormat "2.3")
(date "Tue 17/Mar/1998 14:59:12 ")
(veerev "4.01")
(platform "PC")
(execMode fast)
(filterNAN 0)
(workspaceStackingOrder M)
(SaveCF yes)
(Colors
(Property "Detail View" "Light Beige" bwGrayScale 10)
(Property "Panel View" "Light Blue Gray")
(Property "Workspace" "Dark Gray")
(Property "Line Color" "Black" bwGrayScale 100)
(Property "Line Color (numeric)" "Dark Sky Blue" bwGrayScale 100)
(Property "Line Color (complex)" "Dark Sky Blue" bwGrayScale 100)
(Property "Line Color (string)" "Med Orange" bwGrayScale 100)
(Property "Line Color (sequence out)" "Med Dark Gray" bwGrayScale 100)
(Property "Line Color (highlight)" "Red" bwGrayScale 100)
(Property "Print ID Number BG Color" "Lightest Gray" bwGrayScale 10)
(Property "Tool Tip" "Pale Yellow" bwGrayScale 0)
(Property "Tool Tip Text" "Black" bwGrayScale 100)
(Property "Object Title" "Blue Gray" bwGrayScale 30)
(Property "Object Title Text" "Black" bwGrayScale 100)
(Property "Object" "Light Blue Gray")
(Property "Object Text" "Black")
(Property "Object Shadow" "Darkest Gray")
(Property "Object Step Highlight" "Yellow")
(Property "Object Execute Highlight" "Light Green")
(Property "Object Trail Highlight" "Med Green")
(Property "Object Error Highlight" "Red")
(Property "Object Breakpoint Highlight" "Orange")
(Property "Object Discovery Highlight" "Blue")
(Property "Dialog Box Title Bar" "Dark Blue" bwGrayScale 50)
(Property "Dialog Box Title Bar Text" "White" bwGrayScale 0)
(Property "Dialog Box" "Gray")
(Property "Dialog Box Text" "Black")
(Property "Graph Background" "Black" bwGrayScale 0)
(Property "Trace Pen 0" "Black" bwGrayScale 100)
(Property "Trace Pen 1" "White" bwGrayScale 100)
(Property "Trace Pen 2" "Red" bwGrayScale 100)
(Property "Trace Pen 3" "Green" bwGrayScale 100)
(Property "Trace Pen 4" "Yellow" bwGrayScale 100)
(Property "Trace Pen 5" "Blue" bwGrayScale 100)
(Property "Trace Pen 6" "Magenta" bwGrayScale 100)
(Property "Trace Pen 7" "Cyan" bwGrayScale 100)
(Property "Trace Pen 8" "Dark Yellow" bwGrayScale 100)
(Property "Trace Pen 9" "Dark Gray" bwGrayScale 100)
(Property "Edit Field" "White")
(Property "Edit Field Text" "Black")
(Property "Highlighted Edit Field" "Dark Blue")
(Property "Highlighted Edit Field Text" "White")
(Property "Menu" "Gray")
(Property "Menu Text" "Black")
(Property "Disabled Menu Text" "Dark Gray")
(Property "Highlighted Menu" "Dark Blue")
(Property "Highlighted Menu Text" "White"))
(Fonts
(Property "Menu Text" "Arial" 14)
(Property "Object Title Text" "Arial" 14)
(Property "Object Text" "Arial" 14)
(Property "Object Description Text" "Courier New" 14)
(Property "Terminal Text" "Arial" 12)
(Property "Notepad Text" "Courier New" 14)
(Property "Logging AlphaNumeric Text" "Courier New" 14)
(Property "AlphaNumeric Scalar Text" "Arial" 18)
(Property "AlphaNumeric Array Text" "Arial" 14)
(Property "Bus Monitor Text" "Courier New" 14)
(Property "Dialog Box Title Bar Text" "Arial" 14)
(Property "Dialog Box Text" "Arial" 12)
(Property "Printout Page Header Text" "Arial" 14)
(Property "Printout Object Title Text" "Arial" 14)
(Property "Printout Object Description Text" "Courier New" 14)
(Property "Printout Object ID Number Text" "Arial" 12)
(Property "ToPrinter Printout Text" "Courier New" 14)
(Property "Tool Tip Text" "Arial" 12))
(device 0 ROOTCONTEXT
(properties
(trigMode deg)
(nextID 44)
(popupTitleText "Untitled")
(popupMoveable 1)
(deleteGlobals 0))
(deviceList
(device 36 CONTEXT
(properties
(name "Search number in array")
(trigMode deg)
(nextID 12)
(popupMoveable 1))
(deviceList
(device 0 CONSTANT
(properties
(name "Array"))
(interface
(output 1
(name "Int32")
(lock name constraints)))
(implementation
(value Int32
(numDims 1)
(size 10)
(data  [ 0 2 5 2 4 3 1 3 8 20 ]))
(initValue Int32
(data  0))))
(device 1 FORMULA
(properties
(expr 1 "totSize(A)"))
(interface
(input 1
(name "A")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 2 ALLOCATEARRAY
(properties
(name "Alloc Integer"))
(interface
(input 1
(name "Dim Size 1")
(tag "Dim Size 1")
(requires
(datatype Int32)
(shape "Scalar"))
(lock constraints)
(optional yes)
(buffer YES))
(input 2
(name "Init Value")
(tag "Init Value")
(requires
(datatype Int32)
(shape "Scalar"))
(lock constraints)
(optional yes)
(buffer YES))
(output 1
(name "Array")
(tag "Array")))
(implementation
(numDims 1)
(dimSizes "10")
(type "Int32")
(initEnum "Init Value")
(initialValue
(data  3))
(from 1)
(thru 10)))
(device 3 COMPARATOR
(properties
(relation !=))
(interface
(input 1
(name "Ref Value")
(tag "RefValue"))
(input 2
(name "Test Value")
(tag "TestValue"))
(output 1
(name "Passed")
(tag "Passed")
(lock name constraints)
(optional yes))
(output 2
(name "Failed")
(tag "Failed")
(lock name constraints)
(optional yes))
(output 3
(name "Failures")
(tag "Failures")
(lock name constraints)
(optional yes))))
(device 4 CONSTANT
(properties
(name "Number"))
(interface
(output 1
(name "Int32")
(lock name constraints)))
(implementation
(value Int32
(data  3))
(initValue Int32
(data  0))))
(device 5 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 6 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 7 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 8 FROMCOORDINATE
(interface
(input 1
(name "Coord Data")
(requires
(datatype Coord))
(lock name constraints))
(output 1
(name "X Data")
(lock name constraints))
(output 2
(name "Y Data")
(lock name constraints)
(optional yes))))
(device 9 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 10 TEXTDISPLAY
(properties
(name "Array index of number"))
(interface
(input 1
(name "Data"))))
(device 11 CONFIRM25
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(configuration
(connect D0:1 D1:1)
(connect D1:1 D2:1)
(connect D4:1 D2:2)
(connect D0:1 D3:1)
(connect D2:1 D3:2)
(connect D3:1 D5:1)
(connect D3:2 D6:1)
(connect D3:3 D7:1)
(connect D3:3 D8:1)
(connect D8:2 D9:1)
(connect D8:1 D10:1))
(ShowOnExecPanel
(relativeOrigin 321 57)))
(contextCarrier
(active panel)
(panel
(extent 272 474)
(widget 0 detail
(relativeOrigin 20 10)
(title on)
(borderStyle flat)
(extent 182 174)
(showFormat int))
(widget 4 detail
(relativeOrigin 20 220)
(title on)
(borderStyle flat)
(extent 84 30)
(showFormat int))
(widget 10 detail
(relativeOrigin 20 290)
(title on)
(borderStyle flat)
(extent 186 68))
(widget 11 detail
(relativeOrigin 70 410)
(title off)
(borderStyle none)
(extent 100 40)))
(detail
(extent 976 574)
(anchorPt -51 -58)
(configuration
(devCarrierFor 0
(active open)
(icon
(extent 38 0))
(open
(extent 182 174)
(showFormat int))
(pinCenter 170 170))
(devCarrierFor 1
(active open)
(icon)
(open
(extent 108 32))
(terminals on)
(pinCenter 170 350))
(devCarrierFor 2
(active open)
(icon)
(open
(extent 208 117))
(terminals on)
(pinCenter 480 400))
(devCarrierFor 3
(active open)
(icon)
(open
(extent 214 70))
(terminals on)
(pinCenter 565 220))
(devCarrierFor 4
(active open)
(icon
(extent 53 0))
(open
(extent 89 30)
(showFormat int))
(pinCenter 110 430))
(devCarrierFor 5
(active open)
(icon)
(open
(extent 131 28))
(pinCenter 840 200))
(devCarrierFor 6
(active open)
(icon)
(open
(extent 131 28))
(pinCenter 840 260))
(devCarrierFor 7
(active open)
(icon)
(open
(extent 133 202))
(pinCenter 840 410))
(devCarrierFor 8
(active icon)
(icon
(extent 100 52)
(iconImage "unbuild.icn"))
(open)
(terminals on)
(pinCenter 610 560))
(devCarrierFor 9
(active open)
(icon)
(open
(extent 131 28))
(pinCenter 840 620))
(devCarrierFor 10
(active open)
(icon
(extent 152 0))
(open
(extent 188 37))
(pinCenter 870 560))
(devCarrierFor 11
(active open)
(icon)
(open
(extent 47 22))
(title off)
(pinCenter 300 540))
(connect D0:1 D1:1
(points 6 263 170 280 170 280 280 60 280 60 350 83 350))
(connect D1:1 D2:1
(points 6 276 350 290 350 290 360 280 360 280 370 293 370))
(connect D4:1 D2:2
(points 2 157 430 293 430))
(connect D0:1 D3:1
(points 4 263 170 280 170 280 200 385 200))
(connect D2:1 D3:2
(points 6 626 400 650 400 650 300 370 300 370 240 385 240))
(connect D3:1 D5:1
(points 2 734 200 772 200))
(connect D3:2 D6:1
(points 4 734 220 750 220 750 260 772 260))
(connect D3:3 D7:1
(points 4 734 240 740 240 740 410 771 410))
(connect D3:3 D8:1
(points 8 734 240 740 240 740 410 730 410 730 480 540 480 540 560 557 560))
(connect D8:2 D9:1
(points 4 662 570 680 570 680 620 772 620))
(connect D8:1 D10:1
(points 4 662 550 680 550 680 560 773 560)))
(stackingOrder 1 2 3 6 7 4 0 5 9 10 8 11))))
(device 40 CONTEXT
(properties
(name "Search caracter in string")
(trigMode deg)
(nextID 15)
(popupMoveable 1))
(deviceList
(device 0 LITERALCONSTANT
(properties
(name "String"))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  "as,d,s,fdgg"))
(initValue Text
(data  ""))))
(device 1 FROMSTRING
(properties
(transactions 1 "READ TEXT x CHAR:1 ARRAY:*"))
(interface
(input 1
(name "AString")
(requires
(datatype Text))
(lock name constraints))
(output 1
(name "X")
(optional yes)))
(implementation
(attr iopath string read "string"
(readTerm "
")
(fs " ")
(eol "
")
(multiField fullSyntax)
(arrayFormat block))))
(device 2 FORMULA
(properties
(name "charToInt(str)")
(expr 1 "charToInt(str)"))
(interface
(input 1
(name "str")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 3 FORMULA
(properties
(name "charToInt(str)")
(expr 1 "charToInt(str)"))
(interface
(input 1
(name "str")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 4 FORMULA
(properties
(expr 1 "totSize(A)"))
(interface
(input 1
(name "A")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 5 LITERALCONSTANT
(properties
(name "Character"))
(interface
(output 1
(name "Text")
(lock name constraints)))
(implementation
(value Text
(data  ","))
(initValue Text
(data  ""))))
(device 6 ALLOCATEARRAY
(properties
(name "Alloc Text"))
(interface
(input 1
(name "Dim Size 1")
(tag "Dim Size 1")
(requires
(datatype Int32)
(shape "Scalar"))
(lock constraints)
(optional yes)
(buffer YES))
(input 2
(name "Init Value")
(tag "Init Value")
(requires
(datatype Text)
(shape "Scalar"))
(lock constraints)
(optional yes)
(buffer YES))
(output 1
(name "Array")
(tag "Array")))
(implementation
(numDims 1)
(dimSizes "11")
(type "Text")
(initEnum "Init Value")
(initialValue
(data  ","))))
(device 7 COMPARATOR
(properties
(relation !=))
(interface
(input 1
(name "Ref Value")
(tag "RefValue"))
(input 2
(name "Test Value")
(tag "TestValue"))
(output 1
(name "Passed")
(tag "Passed")
(lock name constraints)
(optional yes))
(output 2
(name "Failed")
(tag "Failed")
(lock name constraints)
(optional yes))
(output 3
(name "Failures")
(tag "Failures")
(lock name constraints)
(optional yes))))
(device 8 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 9 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 10 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 11 TEXTDISPLAY
(properties
(name "Character pos in string"))
(interface
(input 1
(name "Data"))))
(device 12 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 13 FROMCOORDINATE
(interface
(input 1
(name "Coord Data")
(requires
(datatype Coord))
(lock name constraints))
(output 1
(name "X Data")
(lock name constraints))
(output 2
(name "Y Data")
(lock name constraints)
(optional yes))))
(device 14 CONFIRM25
(interface
(output 1
(name "Go")
(lock name constraints)))
(implementation))
(configuration
(connect D0:1 D1:1)
(connect D1:1 D2:1)
(connect D6:1 D3:1)
(connect D1:1 D4:1)
(connect D4:1 D6:1)
(connect D5:1 D6:2)
(connect D2:1 D7:1)
(connect D3:1 D7:2)
(connect D7:1 D8:1)
(connect D7:2 D9:1)
(connect D7:3 D10:1)
(connect D13:1 D11:1)
(connect D13:2 D12:1)
(connect D7:3 D13:1))
(ShowOnExecPanel
(relativeOrigin 642 97)))
(contextCarrier
(active panel)
(panel
(extent 278 348)
(widget 0 detail
(relativeOrigin 30 30)
(title on)
(borderStyle flat)
(extent 194 30))
(widget 5 detail
(relativeOrigin 30 100)
(title on)
(borderStyle flat)
(extent 194 30))
(widget 11 detail
(relativeOrigin 30 180)
(title on)
(borderStyle flat)
(extent 194 37))
(widget 14 detail
(relativeOrigin 80 280)
(title off)
(borderStyle none)
(extent 120 40)))
(detail
(extent 1251 605)
(anchorPt -126 41)
(configuration
(devCarrierFor 0
(active open)
(icon)
(open
(extent 194 30))
(pinCenter 260 100))
(devCarrierFor 1
(active icon)
(icon
(extent 81 16))
(open
(extent 254 78))
(terminals on)
(pinCenter 420 100))
(devCarrierFor 2
(active icon)
(icon
(extent 94 16))
(open
(extent 120 31))
(terminals on)
(pinCenter 550 100))
(devCarrierFor 3
(active icon)
(icon
(extent 94 16))
(open
(extent 120 31))
(terminals on)
(pinCenter 540 140))
(devCarrierFor 4
(active icon)
(icon
(extent 57 16))
(open
(extent 108 32))
(terminals on)
(pinCenter 440 200))
(devCarrierFor 5
(active open)
(icon)
(open
(extent 194 30))
(pinCenter 370 250))
(devCarrierFor 6
(active icon)
(icon
(extent 67 25))
(open
(extent 227 117))
(terminals on)
(pinCenter 530 210))
(devCarrierFor 7
(active icon)
(icon
(extent 82 34))
(open
(extent 214 70))
(terminals on)
(pinCenter 670 110))
(devCarrierFor 8
(active open)
(icon)
(open
(extent 131 28))
(pinCenter 840 40))
(devCarrierFor 9
(active open)
(icon)
(open
(extent 131 28))
(pinCenter 840 110))
(devCarrierFor 10
(active open)
(icon)
(open
(extent 133 202))
(pinCenter 840 260))
(devCarrierFor 11
(active open)
(icon
(extent 158 0))
(open
(extent 194 37))
(pinCenter 870 410))
(devCarrierFor 12
(active open)
(icon)
(open
(extent 131 28))
(pinCenter 840 480))
(devCarrierFor 13
(active icon)
(icon
(extent 100 52)
(iconImage "unbuild.icn"))
(open)
(terminals on)
(pinCenter 670 400))
(devCarrierFor 14
(active open)
(icon)
(open
(extent 47 22))
(title off)
(pinCenter 390 400))
(connect D0:1 D1:1
(points 2 359 100 377 100))
(connect D1:1 D2:1
(points 2 463 100 500 100))
(connect D6:1 D3:1
(points 6 566 210 580 210 580 170 470 170 470 140 490 140))
(connect D1:1 D4:1
(points 6 463 100 480 100 480 130 390 130 390 200 409 200))
(connect D4:1 D6:1
(points 2 471 200 494 200))
(connect D5:1 D6:2
(points 4 469 250 480 250 480 220 494 220))
(connect D2:1 D7:1
(points 2 599 100 626 100))
(connect D3:1 D7:2
(points 4 589 140 610 140 610 120 626 120))
(connect D7:1 D8:1
(points 4 713 100 730 100 730 40 772 40))
(connect D7:2 D9:1
(points 2 713 110 772 110))
(connect D7:3 D10:1
(points 4 713 120 720 120 720 260 771 260))
(connect D13:1 D11:1
(points 4 722 390 750 390 750 410 770 410))
(connect D13:2 D12:1
(points 4 722 410 740 410 740 480 772 480))
(connect D7:3 D13:1
(points 6 713 120 720 120 720 260 600 260 600 400 617 400)))
(stackingOrder 3 2 1 6 4 7 8 9 10 13 12 0 5 11 14))))
(device 43 NOTE
(properties
(text2 1 "Press Run")))
(configuration))
(contextCarrier
(wndRestoredOrigin 2 2)
(wndRestoredExtent 1005 613)
(wndState max)
(active detail)
(detail
(extent 1020 629)
(anchorPt 169 -342)
(configuration
(devCarrierFor 36
(active icon)
(icon
(extent 163 16))
(open
(extent 272 426)
(carbonCopy))
(terminals on)
(bg "Light Blue Gray")
(pinCenter 190 620))
(devCarrierFor 40
(active icon)
(icon
(extent 170 16))
(open
(extent 278 348)
(carbonCopy))
(terminals on)
(bg "Light Blue Gray")
(pinCenter 440 620))
(devCarrierFor 43
(active open)
(icon
(iconImage "notepad.icn"))
(open
(extent 252 114)
(editing enabled))
(pinCenter 80 430)))
(stackingOrder 0 1 2))
(numberFormats
(realFormat standard)
(realSigDigits 4)
(realRadixSpec 4)
(integerBase decimal))))

Outcomes