NetBasic API Reference


Module:DATA.NLM
Purpose:Perform bitwise AND operation on two integer values and return result
Syntax:<iValue>=DATA:And(<iValue1>,<iValue2>)
Description:Compare each bit in <iValue1> against the corresponding bit in <iValue2>. If both bits are 1 return a 1 in the corresponding bit of <iValue>. If either bit is 0, or if both bits are 0, return a 0 in the corresponding bit of <iValue>.
Outputs:Type: Integer
Define:<iValue> is the product of the bitwise AND computation of <iValue1> and <iValue2>.
See Also:Data:Or, Data:Shift:Left , Data:Shift:Right
Example:Value = DATA:And(6, 2)
Print(Value); ' Value = 2
Value = DATA:And(6,8)
Print(Value); ' Value = 0

Go to Table of Contents

DATA:Ascii

Module:NB.NLM
Purpose:Determine the ASCII code equivalent for the first character of a string.
Syntax:<iAscii> = DATA:Ascii (<sString>)
Description:DATA:Ascii returns the integer <iAscii> that represents the ASCII code equivalent for the first character in the string <sString>.
Outputs:Integer
See Also:DATA:Char, Appendicies
Example:PRINT(DATA:Ascii("ABCD"))

Go to Table of Contents

DATA:Char

Module:NB.NLM
Purpose:Determine the ASCII character equivalent of an integer.
Syntax:<sCharacter> = DATA:Char (<iAscii>)
Description:DATA:Char returns the character <sCharacter> that represents the ASCII character equivalent for the integer <iAscii>.
Outputs:String
See Also:DATA:Ascii, Appendicies
Example:Print(DATA:Char(65),DATA:Char(66),DATA:Char(67))

Go to Table of Contents

DATA:Hex:Integer

Module:NB.NLM
Purpose:Determine the decimal value of a hexadecimal number.
Syntax:<iInteger> = DATA:Hex:Integer (<sHex>)
Description:DATA:Hex:Integer returns the integer <iInteger> which represents the decimal value for the hexadecimal number supplied as the string <sHex>.
Outputs:Integer
See Also:DATA:Integer:Hex, DATA:Integer
Example:Print(DATA:Hex:Integer("3FA10D"))

Go to Table of Contents

DATA:Integer

Module:NB.NLM
Purpose:Convert any data type to integer.
Syntax:<iInteger> = DATA:Integer (<xData>)
Description:DATA:Integer returns the integer <iInteger> which represents the integer value for the data <xData>. The data <xData> can be of any type.
Outputs:Integer
See Also:DATA:Real, DATA:String, DATA:Integer:Hex, DATA:Hex:Integer, Appendicies
Example:Print(DATA:Integer("3.14"))

Go to Table of Contents

DATA:Integer:Hex

Module:NB.NLM
Purpose:Determine the hexadecimal representation for a decimal number.
Syntax:<sHex> = DATA:Integer:Hex (<iInteger>)
Description:DATA:Integer:Hex returns the string <sHex> which is the hexadecimal representation for the decimal number <iInteger>.
Outputs:String
See Also:DATA:Hex:Integer, DATA:Integer
Example:Print(DATA:Integer:Hex(3519))

Go to Table of Contents

DATA:Or

Module:DATA.NLM
Purpose:Perform bitwise Or operation on two integer values and return result
Syntax:<iValue>=DATA:Or(<iValue1>,<iValue2>)
Description:Compare each bit in <iValue1> against the corresponding bit in <iValue2>. If both bits are 1, or if either bit is a 1, return a 1 in the corresponding bit of <iValue>. If both bits are 0, return a 0 in the corresponding bit of <iValue>.
Outputs:Type: Integer
Define:<iValue> is the product of the bitwise OR computation of <iValue1> and <iValue2>.
See Also:em:Send(ComPort, "UPDATE.NML")
See Also:DATA:And, Data:Shift:Left , Data:Shift:Right
Example:Value = DATA:Or(6, 2)
Print(Value); ' Value = 6
Value = DATA:And(6,8)
Print(Value); ' Value = 14

Go to Table of Contents

DATA:Real

Module:NB.NLM
Purpose:Convert any data type to real.
Syntax:<rReal> = DATA:Real (<xData>)
Description:DATA:Real returns the real number <rReal> that represents the data <xDate> converted from any data type to real.
Outputs:Real
See Also:DATA:Integer, DATA:String
Example:RealNumber = DATA:Real("3.14")
RealNumber = RealNumber + 1.21
Print(RealNumber)

Go to Table of Contents

DATA:Shift:Left

Module:DATA.NLM
Purpose:Shift bits in <iValue1> to the left <iValue2> number of positions
Syntax:<iValue>=DATA:Shift:Left(<iValue1>,<iValue2>)
Description:Shift bits in <iValue1> to the left <iValue2> number of positions, and set the shifted left most bits to zero.
Outputs:Type: Integer
Define:<iValue> is the product of the bitwise SHIFT:Left computation of <iValue1> and <iValue2>.
See Also:em:Send(ComPort, "UPDATE.NML")
See Also:DATA:And, Data:Or, Data:Shift:Right
Example:Value = DATA:Shift:Left(9,3)
Print(Value); 'Value = 72
Value = DATA:Shift:Left(26,2)
Print(Value); 'Value = 104

Go to Table of Contents

DATA:Shift:Right

Module:DATA.NLM
Purpose:Shift bits in <iValue1> to the right <iValue2> number of positions
Syntax:<iValue>=DATA:Shift:Right(<iValue1>,<iValue2>)
Description:Shift bits in <iValue1> to the right <iValue2> number of positions, and set the shifted right most bits to zero.
Outputs:Type: Integer
Define:<iValue> is the product of the bitwise SHIFT:Right computation of <iValue1> and <iValue2>.
See Also:em:Send(ComPort, "UPDATE.NML")
See Also:DATA:And, Data:Or, Data:Shift:Left
Example:Value = DATA:Shift:Right(9,3)
Print(Value); 'Value = 1
Value = DATA:Shift:Right(26,2)
Print(Value); ' Value = 6

Go to Table of Contents

DATA:String

Module:NB.NLM
Purpose:Convert any data type to string.
Syntax:<sString> = DATA:String (<xDate>)
Description:DATA:String returns the string <sString> representing the data <xDate>. The data <xDate> can be of any type.
Outputs:String
See Also:DATA:Integer, DATA:Real, Appendicies
Example:Print("Pi is " + DATA:String(3.14))

Go to Table of Contents

DATA:Translate

Module:DATA.NLM
Purpose:Converts nonprintable characters in a string to spaces.
Syntax:<sData> = DATA:Translate(<sString>)
Description:The Data:Translate API translates the string specified by <sString> to printable characters only. All control characters including formatting characters are mapped to a space (ASCII 32). This is useful for mapping data that has extended characters, such as line draw characters etc., to display correctly on devices or windows that do not support the extended character set.
Outputs:String
See Also:**
Example:sNew = DATA:Translate("Hello, world" + Chr(179))

Go to Table of Contents

DATA:Type

Module:NB.NLM
Purpose:Determine the type of memory variable.
Syntax:<sType> = DATA:Type (<sVariableName>)
Description:DATA:Type returns the string <sType>, that represents the type of the memory variable, specified by the name <sVariableName>. The following table shows the meaning of each code returned by the DATA:Type command.
CodeDataType
SString
RReal
IInteger, Handle
OObject
LLogical
UUnknown
Outputs:String
Note:The memory variable name must be enclosed in quotation marks. Unknown means that no value is assigned to the memory variable or that the variable is declared as local.
See Also:Appendicies
Example:Counter = 1
Print(DATA:Type("Counter"))

Go to Table of Contents

DATE:Object

Module:NB.NLM
Purpose:Get the date object for total number of seconds since January 1, 1970.
Syntax:<oDate> = DATE:Object(<iUTFSeconds>)
Description:DATE:Object returns the date object <oDate> that contains the date and time information for UTF seconds <iUTFSeconds>. The UTF second is the total number of seconds between January 1, 1970, and any subsequent date. The command DATE:UTF determines the UTF seconds and is used to keep accurate track of time since January 1, 1970, which is considered the beginning of time. For example, to find detailed information on any time and date in the future, add the desired number of seconds to today's UTF seconds and find the UTF seconds for the future date. Next use the DATE:Object command and get the date object for the newly calculated UTF seconds.
Outputs:Date Object
Attributes:[Read-Only]: Year, Utf.Year.Century, Utf.Year.Day, Utf.Year.Week, Utf.Year.Leap, Month, Utf.Month.Name, Utf.Month.Days, Day, Utf.Day.Name, Date, Time, Utf.Time.Hour, Utf.Time.AmPm, Utf.Time.Minute, Utf.Time.Second, Utf.Time.AmPmHour and Error.
See Also:DATE:UTF
Example:Seconds = DATE:UTF("03-21-93")
DateObj = DATE:Object(Seconds)
If (DateObj.Error = 0)
Print("The weekday is ",DateObj.Utf.Day.Name)
EndIf

Go to Table of Contents

DATE:UTF

Module:NB.NLM
Purpose:Determine the number of seconds between January 1, 1970, and a given date.
Syntax:<iUTFSeconds> = DATE:UTF([<sDate>[,<sTime>]])
Description:DATE:UTF returns the number of seconds between January 1, 1970, and the date <sDate> and time <sTime>. January 1, 1970, is considered the beginning of time (Universal Time Format), and seconds are used to keep accurate track of time. When the optional parameter <sDate> is not supplied, today's date is assumed. When the optional parameter <sTime> is not supplied, the current time is assumed.
Outputs:Integer
See Also:1
Print(DATA:Type("Counter"))
See Also:DATE:Object, Appendicies
Example:SecondsInWeek = 7*24*60*60*60
ServerDateObj = NET:Server:Date:Get
If (ServerDateObj.Error=0)
Date=ServerDateObj.Date
Time=ServerDateObj.Time
NextWeek = DATE:UTF(Date,Time)+SecondsInWeek)
DateObj = DATE:Object(NextWeek)
If (DateObj.Error=0)
Print("Date for next week is ",DateObj.Date)
EndIf
EndIf

Go to Table of Contents

DEBUG:Number

Module:NB.NLM
Purpose:Determine the current line number in the program.
Syntax:<iLine> = DEBUG:Number
Description:DEBUG:Number is used for debugging and returns the integer <iLine> that represents the line of the source code that contains the DEBUG:Number command.
Outputs:Integer
See Also:DEBUG:Off , DEBUG:On , Appendicies
Example:Print("This is line ",DEBUG:Number)

Go to Table of Contents

DEBUG:Off

Module:NB.NLM
Purpose:Run the program without the debugs prompt.
Syntax:DEBUG:Off
Description:DEBUG:Off runs the program normally without the debug prompt. When the command DEBUG:On is issued, the flow of the program is interrupted and the debug prompt is displayed on the first line of the screen. The debug prompt provides an option for executing the program one line at a time. The DEBUG:Off command can be used after the DEBUG:On command to skip a block of code that does not require line-by-line execution. The DEBUG:Off command runs the program normally until the DEBUG:On command is encountered.
See Also:s ",DateObj.Date)
EndIf
EndIf
See Also:DEBUG:Number, DEBUG:On
Example:DEBUG:ON
WIN:Clear
Print("Directory listing")
FileCount = 0
DEBUG:Off
Do While (True)
DirObj = DIR:File:First("*.*")
If (DirObj.Error !=0); Exit; EndIf
Print(DirObj.Name," ",DirObj.Extension); Newline
FileCount = FileCount + 1
DirObj = DIR:File:Next(DirObj)
EndDo
DEBUG:On
If (FileCount > 0)
Print("Number of files listed: ", FileCount)
Else
Print("No file listed")
EndIf

Go to Table of Contents

DEBUG:On

Module:NB.NLM
Purpose:Interrupt the flow of the program and display the debug prompt.
Syntax:DEBUG:On
Description:DEBUG:On interrupts the flow of the program and displays the debug prompt on the first line of the screen. The debug prompt provides the options "S" to step through the program one line at a time, "R" to run the program normally until another DEBUG:On command is encountered, "L" to view a specified line of the source code, "V" to view the value assigned to a memory variable, "C" to change the value assigned to a memory variable and "Q" to quit the program.
See Also:s ",DateObj.Date)
EndIf
EndIf
See Also:DEBUG:Number, DEBUG:Off
Example:WIN:Clear
Print("Directory listing")
DEBUG:On
FileCount = 0
Do While (True)
DirObj = DIR:File:First("*.*")
If (DirObj.Error !=0); Exit; EndIf
Print(DirObj.Name," ",DirObj.Extension); Newline
FileCount = FileCount + 1
DirObj = DIR:File:Next(DirObj)
EndDo
If (FileCount > 0)
Print("Number of files listed: ", FileCount)
Else
Print("No file listed")
EndIf

Go to Table of Contents

DIR:Change

Module:DIR.NLM
Purpose:Changes the current directory.
Syntax:<lSuccess> = DIR:Change(<sPath>)
Description:Changes the current directory to <sPath>.
Outputs:Logical
See Also:DIR:Current, DIR:Delete, DIR:Make, DIR:Rename
Example:If !(DIR:Change("SYS:\"))
Print("Cannot change directory");Newline
Endif

Go to Table of Contents

DIR:Current

Module:DIR.NLM
Purpose:Get the current directory.
Syntax:<sPath> = Dir:Current
Description:Returns a string with the full current directory path.
Outputs:String
See Also:Print("No file listed")
EndIf
See Also:DIR:Change, DIR:Delete, DIR:Make, DIR:Rename
Example:Print(Dir:Current);Newline

Go to Table of Contents

DIR:Delete

Module:DIR.NLM
Purpose:Delete a directory.
Syntax:<lSuccess> = DIR:Delete(<sPath>,[<lSwitch>])
Description:Deletes the directory <sPath>. If the optional parameter <lSwitch> is passed as true all subdirectories under the directory <sPath> will be deleted. The default for <lSwitch> is false.
Outputs:Logical
See Also:Print("No file listed")
EndIf
See Also:DIR:Change, DIR:Current, DIR:Make, DIR:Rename
Example:If (!DIR:Delete("SYS:\DELME")
Print("Cannot delete directory")
Endif

Go to Table of Contents

DIR:File:Attribute:Change

Module:DIR.NLM
Purpose:Changes the attributes for a file.
Syntax:<lSuccess> = DIR:File:Attribute:Change(<sTargetFile>,<iAttr>)
Description:Changes the attributes for the file <sTargetFile>. The value for <sTargetFile> is either a full path for the file or the name of the file in the current directory. The attribute to be changed is passed as an integer value <iAttr>. The possible integer values are:
Note:DIR.H must be included in the program in order to take advantage of the reserved attribute names.
ValueAttribute
1Read-only
2Hidden
4System
8Execute-only
32Archive
128Sharable
4096Transaction
16384Read Audit
32768Write Audit
65536Immediate Purge
524288Copy Inhibit
131072Rename Inhibit
262144Delete Inhibit
33554432Immediate Compression
134217728Don't Compress
Outputs:Logical
See Also:**
Example:If (DIR:File:Attribute:Change("AUTOEXEC.NML",8)
Print("Cannot change file attribute");Newline
Endif

Go to Table of Contents

DIR:File:Copy

Module:NB.NLM
Purpose:Copy a file.
Syntax:<lCopied> = DIR:File:Copy (<sSourceFile>, <sTargetFile>)
Description:DIR:File:Copy copies the source file specified by the file name<sSourceFile> to the destination file specified by the name <sTargetFile>. If the destination file <sTargetFile> already exists, it will be overwritten by the source file <sSourceFile>. Both source and destination file names may include path names. The returned logical <lCopied> is true when the file is properly copied, and is false otherwise. When the returned logical is false, the Err command returns a number which may be used to identify the cause of the failure.
Outputs:Logical
See Also:DIR:File:Get, DIR:Path:Get, DIR:ObjectDIR:Object, Appendicies
Error:ERR_FILE_ACCESS, ERR_FILE_IO
Example:If (DIR:File:Copy("SYS:\USER.TXT", "SYS:\USER.BAK"))
Print("File is copied")
Else
Print("File is not copied")
EndIf

Go to Table of Contents

DIR:File:Date:Change

Module:DIR.NLM
Purpose:Changes the date and time of a file.
Syntax:<lSuccess> = Dir:File:Date:Change(<sTargetFile>,<iUTFDate>)
Description:Changes the date and time a file was created.
See Also:**
Outputs:Logical


Go to Table of Contents

DIR:File:Delete

Module:DIR.NLM
Purpose:Delete a file.
Syntax:<lSuccess> = DIR:File:Delete(<sFilename>)
Description:Deletes the file <sFilename> from the current directory. If the file is in another directory the full path can be added to the filename.
Outputs:Logical
See Also:Print("No file listed")
EndIf
See Also:DIR:Change, DIR:Current, DIR:Make, DIR:Rename
Example:If (!DIR:File:Delete("SYS:\DELME")
Print("Cannot delete file ")
Endif

Go to Table of Contents

DIR:File:First

Module:NB.NLM
Purpose:Get the first file object whose name matches a specified pattern.
Syntax:<oFile> = DIR:File:First (<sFileSpec>)
Description:DIR:File:First gets the first file object for which the file name and extension matches the specified string <sFileSpec>. Wildcard characters asterisk "*" and question mark "?" may be used as part of <sFileSpec> to specify a search pattern. The asterisk matches any length string, and the question mark matches only one character. DIR:File:First returns the object <oFile> that is used to access the file information.
Outputs:File objects
Attributes:[Read-Write]: Name, Extension; [Read-Only]: Type, Size, Date, Time, Error
Note:When the path name is specified as part of the <sName> parameter, the DIR:File:First command searches that path for the file that matches the specified pattern. The DIR:File:First and DIR:File:Next commands are used to retrieve a sequence of files. The DIR:File:Get command resets the file sequence and should not be used as part of the code used to retrieve the files.
See Also:DIR:File:Next, DIR:File:Get, Appendicies
Example:FileObj = DIR:File:First("SYS:\PUBLIC\*.*")
Do While (True)
If (FileObj.Error != 0); Exit; EndIf
Print(FileObj.Name, " ")
Print(FileObj.Extension," "); Newline
FileObj = DIR:File:Next(FileObj)
EndDo

Go to Table of Contents

DIR:File:Get

Module:NB.NLM
Purpose:Get the file object that matches a specified name.
Syntax:<oFile> = DIR:File:Get ([<sFileSpec>])
Description:Retrieve a file object for which the object attributes Name and Extension match the specified string <sFileSpec>. By changing a file objects Name and Extension, and using the altered object when calling DIR:File:Set (<FileObject>) an existing file name can be changed. By erasing a file objects Name and Extension, and using the altered object when calling DIR:File:Set (<FileObject>) an existing file can be deleted. When the optional parameter <sFileSpec> is not specified, DIR:File:Get returns an object containing current directory information. This object can then be used to create a subdirectory below the current directory, by filling in a file objects Name with the subdirectory to be created.
Outputs:File object
Attributes:[Read-Write]: Name, Extension; [Read-Only]: Type, Size, Date, Time, Error
Note:When the path name is specified as part of the <sFileSpec> parameter, the DIR:File:Get command searches that path for the file that matches the specified pattern. The DIR:File:First and DIR:File:Next commands are used to retrieve a sequence of files. The DIR:File:Get command resets the file sequence and should not be used as part of the code used to retrieve the files.
See Also:DIR:Object, DIR:Path:Get, DIR:Path:Set, DIR:File:Set, DIR:File:First, DIR:File:Next, Appendicies
Example:FileObj = DIR:File:Get("PROG1.EXE")
FileObj.Name = "PROG2"
FileObj = DIR:File:Set(FileObj)
Print("PROG1.EXE is renamed to PROG2.EXE")

Go to Table of Contents

DIR:File:Next

Module:NB.NLM
Purpose:Get the next file object listed after a specified file object.
Syntax:<oFile2> = DIR:File:Next (<oFile1>)
Description:DIR:File:Next gets the next file object listed after the file object <oFile1> that matches the file name and extension specified by the previous DIR:File:First command. DIR:File:Next returns the object <oFile2> that contains the attributes for the new file object found.
Outputs:File objects
Attributes:[Read-Write]: Name, Extension; [Read-Only]: Type, Size, Date, Time, Error
Note:The DIR:File:First and DIR:File:Next commands are used to retrieve a sequence of files. The DIR:File:Get command resets the file sequence and should not be used as part of the code used to retrieve the files.
See Also:DIR:File:First, DIR:File:Get, Appendicies
Example:FileObj = DIR:File:First("SYS:\PUBLIC\*.*")
Do While (True)
If FileObj.Error != 0; Exit; EndIf
Print(FileObj.Name, " ")
Print(FileObj.Extension," "); Newline
FileObj = DIR:File:Next(FileObj)
EndDo

Go to Table of Contents

DIR:File:Set

Module:NB.NLM
Purpose:Set the information of a file or directory according to a specified file object.
Syntax:<oFile1> = DIR:File:Set (<oFile2>)
Description:DIR:File:Set changes the file or directory information or creates a directory according to the specified file object <oFile1>. The returned file object <oFile> contains the updated attributes for the file object <oFile1>. DIR:File:Set is the object manager for file objects, and all changes to file and directory information are made by this command. To delete a file, retrieve that file's object using the DIR:File:Get command, assign a null value to the object's Name and Extension attributes, and supply the new object to the DIR:File:Set Command. To create a directory, retrieve a null file object by using the DIR:File:Get command without any parameter, assign a name value to the object's Name attribute, and supply the new object to the DIR:File:Set Command.
Outputs:File object
Attributes:[Read-Write]: Name, Extension; [Read-Only]: Type, Size, Date, Time, Error
See Also:DIR:File:Get
Example:FileObj = DIR:File:Get("PROG1.EXE")
If (FileObj.Error = 0)
FileObj.Name = ""; FileObj.Extension = ""
FileObj = DIR:File:Set(FileObj)
If (FileObj.Error = 0)
Print("PROG1.EXE is deleted")
EndIf
EndIf

Go to Table of Contents

DIR:Make

Module:DIR.NLM
Purpose:Creates a directory.
Syntax:<lSuccess> = Dir:Make(<sPath>)
Description:Creates a directory <sPath>.
Outputs:Logical
See Also:Print("No file listed")
EndIf
See Also:DIR:Change, DIR:Current, DIR:Rename
Example:If (!Dir:Make("SYS:\Temp")
Print("Could not create the directory");Newline
Endif

Go to Table of Contents

DIR:Object

Module:NB.NLM
Purpose:Parse a specified path name.
Syntax:<oDir> = DIR:Object (<sPath>)
Description:DIR:Object returns an object <oDir> containing the path components. The path components are server name, volume name, directory path and file name. The input path <sPath> can contain any combination of wildcard, partial, or relative path and file names.
Outputs:Directory object
Attributes:[Read-Only]: Server.Name, Volume.Name, Path, File.Name, File.Extension, Error
Note:The following are all valid for the parameter <sPath>: "SYS:", "USERS\*.EXE", "..\", "C:\PROGRAMS". The object <oDir> can be used to identify all the files that are referred to by the path <sPath>. For example, when the parameter "SYS:ACCOUNT" is supplied as the path name, the Path attribute of the object <oDir> will be "\ACCOUNT\", and the Name attribute will be "*", if the directory "ACCOUNT" exists in the root of the volume SYS. If ACCOUNT is a file name in the root of the volume SYS:, the Path attribute will be "\", and the Name attribute will be "ACCOUNT".
See Also:DIR:File:Get, DIR:File:Set, Appendicies
Example:DirObj = DIR:Object("..\USERS\MYPROG.EXE")
If (DirObj.Error = 0)
Print("Server is ", DirObj.Server.Name);Newline
Print("Volume is ", DirObj.Volume.Name);Newline
Print("Path is ", DirObj.Path); Newline
Print("Name is ", DirObj.File.Name);Newline
Print("Extension is ", DirObj.File.Extension)
EndIf

Go to Table of Contents

DIR:Path:Get

Module:NB.NLM
Purpose:Get the default Path information.
Syntax:<oPath> = DIR:Path:Get
Description:DIR:Path:Get returns the path object <oPath> that contains information for the default path. The default path can be changed by changing the Volume.Name and Path attributes of the path object <oPath> and supplying the new object to the DIR:Path:Set command.
Outputs:Path object
Attributes:[Read-Write]: Volume.Name, Path; [Read-Only]: Server.Name, Error
See Also:DIR:Path:Set, DIR:Object, Path, Appendicies
Example:PathObj = DIR:Path:Get
If (PathObj.Error = 0)
PathObj.Volume.Name = "SYS:"
PathObj.Path = "\USERS"
PathObj = DIR:Path:Set(PathObj)
If (PathObj.Error = 0)
Print("Default directory is SYS:\Users")
EndIf
EndIf

Go to Table of Contents

DIR:Path:Set

Module:NB.NLM
Purpose:Change the default path according to a specified path object.
Syntax:<oPath2> = DIR:Path:Set (<oPath1>)
Description:DIR:Path:Set changes the default path according to the path object <oPath1>. The Volume.Name and Path attributes of the path object <oPath1> specify the new default path. The returned path object <oPath2> contains the updated attributes for the path object <oPath1>. DIR:Path:Set is the object manager for Path objects, and all changes to paths are made by this command.
Outputs:Path object
Attributes:[Read-Write]: Volume.Name, Path; [Read-Only]: Server.Name, Error
See Also:DIR:Path:Get, DIR:Object, Path, Appendicies
Example:PathObj = DIR:Path:Get
If (PathObj.Error = 0)
PathObj.Volume.Name = "SYS:"
PathObj.Path = "\USERS"
PathObj = DIR:Path:Set(PathObj)
If (PathObj.Error = 0)
Print("Default directory is SYS:\Users")
EndIf
EndIf

Go to Table of Contents

DIR:Rename

Module:NB.NLM
Purpose:Rename a directory.
Syntax:<lSuccess> = Dir:Rename(<sOldName>,<sNewName>)
Description:Renames the directory <sOldName> to <sNewname>.
Outputs:Logical
See Also:Print("No file listed")
EndIf
See Also:DIR:Change, DIR:Current, DIR:Make
Example:If (Dir:Rename("SYS:\TEMP","SYS:\TMP"))
Print("Could not rename directory");Newline
Endif

Go to Table of Contents