Contents 

Overview
Fundamentals
Variable declaration
Variable assignment
Adding variables
Setting variables
Include function
Evaluate function
Constants
Arrays
If...then...else Statement
For Statement
Foreach Statement
While Statement
Function definition
Operators
Comments
Functions
String processing
Overview
Length
Left
Right
Mid
TrimLeft
TrimRight
ToUpper
ToLower
Find
ReverseFind
WildcardCompare
Tokenize
RegularExpressionMatch
RegularExpressionParse
Operator [ ]
Delete
Remove
Replace
File IO routines
Overview
ReadData
ReadDataToString
WriteData
ReadString
WriteString
AppendString
EOF
CloseFile
CreateDir
RemoveDir
ChangeDir
GetCurrentDir
IsFileExist
FileSize
CopyFile
MoveFile
RemoveFile
Seek
SeekToBegin
SeekToEnd
ListFiles
CountFilesInFolder
Time routines
Overview
Sleep
Millisleep
GetTime
GetTimeString
FormatTime
ConvertToUnixTime
GetTickCount
SNMP management
Overview
SnmpGet
SnmpGetNext
SnmpSet
GetPduErrorStatus
GetPduErrorString
GetPduErrorIndex
GetVarCount
GetVarAt
CreatePdu
AppendVar
GetVarOID
GetVarResolvedName
GetVarValue
GetVarResolvedValue
GetVarResolvedDescription
GetVarSyntax
CreateVar
GetPduIp
GetPduEnterprise
GetPduTrapCode
GetPduTrapName
GetPduResolvedTrapName
GetPduResolvedTrapDescription
GetPduCommunity
SendTrap
ForwardTrap
SNMP MIB functions
Overview
LoadMIB
ResolveOID
GetOidByName
ResolveTrap
UnloadMIB
XML processing
Overview
ReadXml
WriteXml
GetXmlTag
CreateXml
InsertAttr
IsXmlValid
SelectXmlNodes
GetAttrString
GetAttrInt
GetAttrDouble
GetXmlBody
SetXmlBody
AddChild
GetChildrenCount
GetChildAt
FTP functions
Overview
FtpOpen
FtpClose
FtpGetCurrentDir
FtpSetCurrentDir
FtpCreateDir
FtpRemoveDir
FtpGet
FtpPut
FtpRemoveFile
FtpRenameFile
FtpListFiles
FtpCountFilesInFolder
TFTP functions
Overview
TFTPGet
TFTPPut
TCP functions
Overview
HttpPing
HttpGet
OpenTCPConnection
OpenUDPSocket
SendTCPData
SendUDPData
IsDataAvailable
ReadTCPData
ReadUDPData
CloseSocket
GetHostByAddress
GetAddressByName
TestSMTPConnection
GetHostName
GetSocketName
TestPOP3Connection
POP3GetStats
POP3 Mail Client Example
Working with serial ports
Overview
OpenSerialPort
CloseSerialPort
IsSerialDataAvailable
ReadSerialData
WriteSerialData
Handling zip files
Overview
ZipFiles
UnzipFiles
AddFileToZip
RemoveFileFromZip
ListFilesInZip
UnzipFile
Mathematical routines
Overview
abs
acos
asin
atan
CalculateScaleFactor
cos
cosh
exp
IsNAN
log
log10
max
mod
pow
ScaleArray
sin
sinh
sqrt
tan
tanh
Charts
Overview
CreateGauge
CreatePieChart
CreateBarChart
CreateLineChart
CreateXYLineChart
Database Interface
Overview
DBOpen
DBClose
DBExecuteSQL
DBSelect
DBInsertSelect
DBGetSQLStatus
DBGetSQLErrorString
Round Robin Databases
Overview
RrdCreate
RrdUpdate
RrdRemove
RrdFetch
RrdGetCurrentValue
Event Log functions
Overview
EventLogGetNumberOfRecords
EventLogGetOldestRecord
EventLogReadRecord
EventLogWaitForEvent
EventLogWriteRecord
Service Control Manager
Overview
SCMEnumerateServices
SCMGetServiceInfo
SCMStartService
Parameter Files
Overview
GetParameterCount
GetParameterName
GetParameterType
GetParameterValue
GetParameterDisplayName
GetParameterDescription
Process management functions
Overview
FindProcess
GetProcesses
RedirectOpen
RedirectClose
RedirectGetStdOut
RedirectGetStdError
RedirectSendInput
WMI functions
Overview
WMIOpen
WMIClose
WMIQuery
WMIGetErrorStatus
Query functions
Overview
LDAPQuery
REGQuery
CSVQuery
TSVQuery
EventLogQuery
TextLineQuery
TextWordQuery
FSQuery
GetQueryStatus
GetQueryErrorString
Windows Networking
Overview
MapNetworkDrive
DisconnectNetworkDrive
Microsoft Outlook integration
Overview
OpenOutlookSession
CloseOutlookSession
OutlookSendMail
OutlookSendMeetingRequest
OutlookCreateTask
Other routines
Overview
Println
MessageBox
ToString
ToInteger
ToDouble
ToChar
ToByte
GetEnv
GetArraySize
Beep
GetArrayIndex
GetNetDecisionSystemDir
IsArrayElementExist
Ping
SendMail
SendHtmlMail
ExecuteCommand
PlaySound
TextToSpeech
SendSMS
Rand

NetDecision Script Language Reference

Prev Page Next Page

SeekToBegin

int SeekToBegin(string filename)

Return Value

Returns the new byte offset from the beginning of the file if operation successful. Otherwise, the return value is FAIL.

Parameters

filename – the name of the file.

Remarks 

Call SeekToBegin function to reposition the pointer to the beginning of the file. No data is actually read during the seek.

Package

Plug in module: nd_fileplg.npl

Example

The following example demonstrates the use of SeekToBegin.

 # Example for SeekToBegin

 string sData

 string sFileName = "C:\test.txt"

 for(int i=0; i<5; i++)

     sData = "String_" + ToString(i)

     WriteString(sFileName, sData)

 endfor

 SeekToBegin(sFileName)

 while(!EOF(sFileName))

     Println(ReadString(sFileName))

 endwhile

 CloseFile(sFileName)

Output of the example script:           

String_0
String_1
String_2
String_3
String_4

   
Converted from CHM to HTML with chm2web Pro 2.76 (unicode)