AnsweredAssumed Answered

vrf Formatting numbers

Question asked by rsb on Apr 16, 2002
I send a presumably "bad" example to obtain a string format fixed type
(NN.N) from a slider.

Can you give me an easier way to do the same?

SURE- - just use a TO STRING as in the below modified example

Stan

(saveFormat "2.3")
(date "Tue 16/Apr/2002 11:12:39 ")
(veerev "6.01")
(platform "PC")
(execMode ole)
(filterNAN 0)
(workspaceStackingOrder M)
(SaveCF no)
(device 0 ROOTCONTEXT
(properties
(trigMode deg)
(nextID 20)
(popupTitleText "Untitled")
(popupMoveable 1)
(deleteGlobals 0))
(deviceList
(device 0 SLIDER
(properties
(name "Real Slider")
(autoTrigger 1)
(range 0 20)
(detents 0.001))
(interface
(output 1
(name "Real")
(lock name constraints)))
(implementation
(value Real
(data  12.326))
(initValue Real
(data  0))))
(device 2 FORMULA
(properties
(name "intPart(x)")
(expr 1 "intPart(x)"))
(interface
(input 1
(name "x")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 3 FORMULA
(properties
(name "fracPart(x)")
(expr 1 "fracPart(x)"))
(interface
(input 1
(name "x")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 8 IFTHENELSE
(properties
(cases 1 "A<10"))
(interface
(input 1
(name "A")
(optional yes))
(output 1
(name "Then")
(lock name constraints))
(output 2
(name "Else")
(lock name constraints))))
(device 9 FORMULA
(properties
(expr 1 ""0"+a"))
(interface
(input 1
(name "A")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 10 GATE
(interface
(input 1
(name "A")
(tag "InData"))
(output 1
(name "X"))))
(device 11 JUNCTION
(properties
(name "JCT"))
(interface
(input 1
(name "A"))
(input 2
(name "B"))
(output 1
(name "Data"))))
(device 12 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 13 FORMULA
(properties
(expr 1 "intPart(a*10)"))
(interface
(input 1
(name "A")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 15 FORMULA
(properties
(expr 1 "a+"."+b"))
(interface
(input 1
(name "A")
(optional yes))
(input 2
(name "B")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 16 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 18 TOSTRING
(properties
(transactions 1 "WRITE TEXT a REAL32 FIX:1 EOL"))
(interface
(input 1
(name "a")
(optional yes))
(output 1
(name "result")
(lock name constraints)))
(implementation
(attr iopath string write "string"
(readTerm "
")
(fs " ")
(eol "
")
(multiField fullSyntax)
(arrayFormat block))))
(device 19 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(configuration
(connect D0:1 D1:1)
(connect D0:1 D2:1)
(connect D1:1 D3:1)
(connect D3:1 D4:0)
(connect D1:1 D4:1)
(connect D3:2 D5:0)
(connect D1:1 D5:1)
(connect D4:1 D6:1)
(connect D5:1 D6:2)
(connect D6:1 D7:1)
(connect D2:1 D8:1)
(connect D6:1 D9:1)
(connect D8:1 D9:2)
(connect D9:1 D10:1)
(connect D0:1 D11:1)
(connect D11:1 D12:1)))
(contextCarrier
(wndRestoredOrigin 2 2)
(wndRestoredExtent 492 348)
(wndState max)
(active detail)
(detail
(extent 1165 946)
(anchorPt 91 126)
(configuration
(devCarrierFor 0
(active open)
(icon)
(open
(extent 103 222)
(layout vertical)
(fastmode off)
(extratics))
(bg "Pale Red")
(titleBg "Med Light Red")
(pinCenter 110 140))
(devCarrierFor 2
(active open)
(icon
(extent 52 0))
(open
(extent 79 32))
(terminals on)
(pinCenter 290 80))
(devCarrierFor 3
(active open)
(icon
(extent 60 0))
(open
(extent 86 32))
(terminals on)
(pinCenter 280 210))
(devCarrierFor 8
(active open)
(icon)
(open
(extent 54 51))
(terminals on)
(pinCenter 515 90))
(devCarrierFor 9
(active open)
(icon)
(open
(extent 71 31))
(terminals on)
(pinCenter 740 140))
(devCarrierFor 10
(active icon)
(icon
(extent 24 14))
(open)
(terminals on)
(pinCenter 640 200))
(devCarrierFor 11
(active icon)
(icon
(extent 26 25))
(open)
(terminals on)
(pinCenter 810 200))
(devCarrierFor 12
(active open)
(icon)
(open
(extent 121 22))
(pinCenter 950 210))
(devCarrierFor 13
(active open)
(icon)
(open
(extent 113 33))
(terminals on)
(pinCenter 520 330))
(devCarrierFor 15
(active open)
(icon)
(open
(extent 71 42))
(terminals on)
(pinCenter 860 320))
(devCarrierFor 16
(active open)
(icon)
(open
(extent 205 31))
(bg "Pale Green")
(titleBg "Med Light Teal")
(pinCenter 140 380))
(devCarrierFor 18
(active open)
(icon
(extent 53 15))
(open
(extent 229 74))
(terminals on)
(pinCenter 250 490))
(devCarrierFor 19
(active open)
(icon)
(open
(extent 205 31))
(bg "Pale Green")
(titleBg "Med Light Teal")
(pinCenter 580 500))
(connect D0:1 D1:1
(points 4 164 140 190 140 190 80 218 80))
(connect D0:1 D2:1
(points 4 164 140 180 140 180 210 204 210))
(connect D1:1 D3:1
(points 4 382 80 400 80 400 90 455 90))
(connect D3:1 D4:0
(points 3 584 80 750 80 750 104))
(connect D1:1 D4:1
(points 4 382 80 400 80 400 140 672 140))
(connect D3:2 D5:0
(points 3 584 100 640 100 640 190))
(connect D1:1 D5:1
(points 6 382 80 400 80 400 140 600 140 600 200 625 200))
(connect D4:1 D6:1
(points 6 828 140 850 140 850 180 780 180 780 190 794 190))
(connect D5:1 D6:2
(points 4 654 200 670 200 670 210 794 210))
(connect D6:1 D7:1
(points 4 825 200 850 200 850 210 887 210))
(connect D2:1 D8:1
(points 4 375 210 390 210 390 330 431 330))
(connect D6:1 D9:1
(points 6 825 200 850 200 850 240 770 240 770 310 792 310))
(connect D8:1 D9:2
(points 2 629 330 792 330))
(connect D9:1 D10:1
(points 6 948 320 970 320 970 420 20 420 20 380 35 380))
(connect D0:1 D11:1
(points 6 164 140 180 140 180 270 10 270 10 490 103 490))
(connect D11:1 D12:1
(points 4 417 490 440 490 440 500 475 500)))
(stackingOrder 3 9 8 7 6 4 0 1 2 5 10 11 12))
(numberFormats
(realFormat standard)
(realSigDigits 4)
(realRadixSpec 4)
(integerBase decimal))))

---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo.  To send messages to
this maillist, just email to "vrf@lvld.agilent.com".  Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.agilent.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.agilent.com".
---------------------------------------------------------------------

Outcomes