AnsweredAssumed Answered

Automating file names

Question asked by VRFuser on Dec 1, 1997
> > For example, this month's data should be saved to:
> >
> > c:folder1folder2dec97_sensor_data
> >
>
> "c:folder1folder2"+month(now())+year(now())+"_sensor_data"
>
> which of course then feeds into a "to file" object for your writing.
>

Had a few minutes so cranked out a VEE program for the above. Note that
my solution modifies your names slightly to be Y2K compliant.

Hopefully this will meet your needs

regards

Stan Bischof
stanb@sr.hp.com



(saveFormat "2.3")
(date "Mon 01/Dec/1997 17:35:09 ")
(veerev "4.01")
(platform "PC")
(execMode fast)
(filterNAN 0)
(workspaceStackingOrder M)
(SaveCF no)
(device 0 ROOTCONTEXT
(properties
(trigMode deg)
(nextID 7)
(popupTitleText "Untitled")
(popupMoveable 1))
(deviceList
(device 0 FORMULA
(properties
(name "calculate file name")
(expr 1 ""c:\\folder1\\folder2\\"+month+year+"_sensor_data""))
(interface
(input 1
(name "Month")
(optional yes))
(input 2
(name "Year")
(optional yes))
(output 1
(name "Result")
(tag "Result")
(lock name constraints)
(optional yes))))
(device 1 TEXTDISPLAY
(interface
(input 1
(name "Data"))))
(device 4 TOSTRING
(properties
(name "Find Month")
(transactions 1
"WRITE CASE month(now())-1 OF "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" EOL"
))
(interface
(output 1
(name "result")
(lock name constraints)))
(implementation
(attr iopath string write "string"
(readTerm "
")
(fs " ")
(eol "
")
(multiField fullSyntax)
(arrayFormat block))))
(device 6 TOSTRING
(properties
(name "Find Year")
(transactions 1 "WRITE TEXT year(now()) STR EOL"))
(interface
(output 1
(name "result")
(lock name constraints)))
(implementation
(attr iopath string write "string"
(readTerm "
")
(fs " ")
(eol "
")
(multiField fullSyntax)
(arrayFormat block))))
(configuration
(connect D2:1 D0:1)
(connect D3:1 D0:2)
(connect D0:1 D1:1)))
(contextCarrier
(wndOrigin 2 2)
(wndState res)
(active detail)
(detail
(extent 600 386)
(anchorPt 0 0)
(configuration
(devCarrierFor 0
(active open)
(icon
(extent 128 0))
(open
(extent 355 42))
(terminals on)
(pinCenter 320 150))
(devCarrierFor 1
(active open)
(icon)
(open
(extent 406 53))
(pinCenter 370 260))
(devCarrierFor 4
(active icon)
(icon
(extent 78 16))
(open
(extent 254 78))
(terminals on)
(pinCenter 40 130))
(devCarrierFor 6
(active icon)
(icon
(extent 68 16))
(open
(extent 254 78))
(terminals on)
(pinCenter 40 160))
(connect D2:1 D0:1
(points 2 81 130 90 140))
(connect D3:1 D0:2
(points 2 76 160 90 160))
(connect D0:1 D1:1
(points 6 550 150 570 150 570 190 140 190 140 260 164 260)))
(stackingOrder 1 2 3 0))
(numberFormats
(realFormat standard)
(realSigDigits 4)
(realRadixSpec 4)
(integerBase decimal))))

Outcomes