You are here: Function Reference > Alphabetical Listing > S > SetDeviceName

SetDeviceName

Use this procedure to set a new output device file name which will be used the next time the output device is opened, assuming nothing overrides the name prior to that. You can use this function when splitting recipient batches into multiple print stream files.

Syntax

SetDeviceName (Device)

Parameter

Description

Device

Enter the new output device file name.

Here is an example of script logic from a post-transaction banner DAL script:

IF TotalSheets() > 16000
#COUNTER += 1
CurFile = DeviceName()
Drive = FileDrive(CurFile)
Path = FilePath(CurFile)
Ext = FileExt(CurFile)
RecipBatch = RecipBatch()
NewFile = FullFileName(Drive,Path,RecipBatch & #COUNTER,Ext)
SetDeviceName(NewFile)
BreakBatch()
END
Note See FileDrive, FileExt, FileName, FilePath, and FullFileName for information on using DAL functions to manipulate file names.

Keep in mind...

The only DAL function actually involved in splitting the print stream is BreakBatch. The others make it easier to implement this functionality. For example, since you need to name the new print stream, you use the SetDeviceName procedure. To find the name of the current device, you use the DeviceName function. If you need to create unique file names, you can use the UniqueString function.

Note While you can call all of these DAL functions in Documaker Server or Entry, the BreakBatch and SetDeviceName functions are not applicable in Entry since it does not use the batch printing engine. The other functions, DeviceName and UniqueString, are applicable to both Entry and Documaker Server.

See also