This command is included for DOS compatibility. The Windows equivalent is Run.
A nested macro starts immediately when called. When a nested macro ends, the first statement following Nest is executed.
PerfectScript automatically compiles uncompiled Nest macros. Macro execution stops if the macro will not compile.
Parameters
MacroFileName: string The path and name of a compiled macro.
{Parameter: any} (optional) Enclose multiple parameters in braces ({ }), separated by a semicolon. For example: Nest ("macro"; {"a"; "b"; "c"}). Parameter values are passed to a special array variable named MacroArgs[ ].
If missing, MacroArgs[ ] is not defined in the new macro.
0 if the connection was successful, or a non-zero value that represents an error code if not.
Type: enumeration or numeric Success!
DialogCancelled! The attempt to make the connection was cancelled by the user through a dialog box.
AccessDenied! Access to the network resource was denied.
AlreadyAssigned! The loacal device is already in the user profile
AlreadyRemembered! An entry for the device is already in the user profile
CantOpenUserProfile! The system is unable to open the user profile to process persistent connections.
DeviceInUse! The device in in use by an active process and cannot be disconnected.
DeviceMismatch! The type of local device and the type of network resource do not match.
FilesStillOpen! There are open files and the Force parameter is False.
InsufficientMemory! There is insufficient memory to start the dialog box.
InvalidDevice! The device specified is invalid.
InvalidNetOrPath! A network component has not started, or the specified name could not be handled.
InvalidParameter! There is a bad combination of parameters.
InvalidPassword! The specified password is invalid.
InvalidProvider! The provider specified does not match any provider.
InvalidResource! The remote name specified is not acceptable to any network resource provider. The resource name is invalid, or the named resource cannot be located.
InvalidUserProfile! The user profile is in an incorrect format.
NetworkError! A network-specific error occurred.
NoConnection! There is no current connection to the remote device, but there is a remembered (persistant) connection to it.
NoNetwork! There is no network present.
NotConnected! The name specified is not a redirected device, or the system is not currently connected to the device.
NotSupported! The network provider is busy, possibly initializing. The caller should retry.
ResourceNotContainer! The resource does not specify a container.
Parameters
RemoteName: string The name of a network resource (refer to your network provider's naming conventions).
LocalName: string (optional) The name of a network resource on a local system (not case sensitive). For example, F: or LPT1. If this parameter is missing, a connection to the network resource is made without redirecting a local device.
Provider: string (optional) Specify a network provider to connect to. If missing or "", the operating system parses RemoteName to try to determine the correct provider. Only use this parameter when a network provider must be specified. Otherwise, Windows should determine which provider the network name maps to. If this parameter is present, Windows will only try to connect to the named provider.
Type: enumeration (optional) Default: Disk!
Disk!
Printer!
Password: string (optional) The password to use when making the connection. If not present, the default password associated with UserName is used. If this parameter is missing or "", no password is used.
UserName: string (optional) The username to use when making a connection. If not present, the default UserName is used (user context provides the default user name). Use this parameter when the user wants to connect to a network resource and they have been assigned a user name or account. UserName may be specific to a network provider, and can be used in a security context.
DontAutoRestore! No information about the connection is stored.
AutoRestore! Windows will not restore the connection in subsequent attempts to log on.
Force: boolean (optional) True disconnects even though there are open files or jobs on the connection. If missing or False, disconnect fails if there are open files or jobs on the connection.
numeric := NetConnectionDlg
Example
Syntax
([Type: enumeration])
Description
Open a dialog box for connecting to network resources.
Return Value
The status code returned by the dialog.
Type: enumeration or numeric Success!
DialogCancelled! The attempt to make the connection was cancelled by the user through a dialog box.
AccessDenied! Access to the network resource was denied.
AlreadyAssigned! The loacal device is already in the user profile
AlreadyRemembered! An entry for the device is already in the user profile
CantOpenUserProfile! The system is unable to open the user profile to process persistent connections.
DeviceInUse! The device in in use by an active process and cannot be disconnected.
DeviceMismatch! The type of local device and the type of network resource do not match.
FilesStillOpen! There are open files and the Force parameter is False.
InsufficientMemory! There is insufficient memory to start the dialog box.
InvalidDevice! The device specified is invalid.
InvalidNetOrPath! A network component has not started, or the specified name could not be handled.
InvalidParameter! There is a bad combination of parameters.
InvalidPassword! The specified password is invalid.
InvalidProvider! The provider specified does not match any provider.
InvalidResource! The remote name specified is not acceptable to any network resource provider. The resource name is invalid, or the named resource cannot be located.
InvalidUserProfile! The user profile is in an incorrect format.
NetworkError! A network-specific error occurred.
NoConnection! There is no current connection to the remote device, but there is a remembered (persistant) connection to it.
NoNetwork! There is no network present.
NotConnected! The name specified is not a redirected device, or the system is not currently connected to the device.
NotSupported! The network provider is busy, possibly initializing. The caller should retry.
ResourceNotContainer! The resource does not specify a container.
Parameters
Type: enumeration (optional) Default: Disk!
numeric := NetDisconnectDlg
Example
Syntax
([Type: enumeration])
Description
Open a dialog box for disconnecting from network resources.
Return Value
The status code returned by the dialog.
Type: enumeration or numeric Success!
DialogCancelled! The attempt to make the connection was cancelled by the user through a dialog box.
AccessDenied! Access to the network resource was denied.
AlreadyAssigned! The loacal device is already in the user profile
AlreadyRemembered! An entry for the device is already in the user profile
CantOpenUserProfile! The system is unable to open the user profile to process persistent connections.
DeviceInUse! The device in in use by an active process and cannot be disconnected.
DeviceMismatch! The type of local device and the type of network resource do not match.
FilesStillOpen! There are open files and the Force parameter is False.
InsufficientMemory! There is insufficient memory to start the dialog box.
InvalidDevice! The device specified is invalid.
InvalidNetOrPath! A network component has not started, or the specified name could not be handled.
InvalidParameter! There is a bad combination of parameters.
InvalidPassword! The specified password is invalid.
InvalidProvider! The provider specified does not match any provider.
InvalidResource! The remote name specified is not acceptable to any network resource provider. The resource name is invalid, or the named resource cannot be located.
InvalidUserProfile! The user profile is in an incorrect format.
NetworkError! A network-specific error occurred.
NoConnection! There is no current connection to the remote device, but there is a remembered (persistant) connection to it.
NoNetwork! There is no network present.
NotConnected! The name specified is not a redirected device, or the system is not currently connected to the device.
NotSupported! The network provider is busy, possibly initializing. The caller should retry.
ResourceNotContainer! The resource does not specify a container.
Parameters
Type: enumeration (optional) Default: Disk!
Disk!
Printer!
string := NetGetConnection
Example
Syntax
(LocalName: string)
Description
Return the name of a network resource associated with a local device.
Example
vNetResource := NetGetConnection ("M:")
Return Value
string is empty when an error occurs.
Parameter
LocalName: string The name of a local device.
string := NetGetUniversalName
Example
Syntax
(LocalPath: string)
Description
Get the UNC name of a local file.
Return Value
UNC name of a local file.
Parameter
LocalPath: string Local name of the file.
string := NetGetUser
Example
Syntax
()
Description
Get a user network ID.
Return Value
User network ID.
NewDefault
Example
Syntax
(<ProductPrefix> identifier)
Description
Specify a macro's new default application. NewDefault accepts the prefix of an OLE object, as well as a product mnemonic.
The compiler verifies that each product command is valid for the default application. Invalid product commands produce a syntax error during compilation. This is a compile-time only statement, and makes the specified object prefix or product mnemonic the current default prefix for unknown commands.
Product commands to the default application do not require a product prefix. A product command to a non-default application, without a product prefix, creates a compile-time syntax error.
Parameters
<ProductPrefix> identifier A unique identifier that matches the ProductPrefix parameter of an Application statement.
Next
Example
Description
Advance a loop iteration before the end of the loop.
Use Next inside a conditional statement such as If or Switch in a loop to advance a loop iteration when a specified condition is met. Statements after Next are ignored.
boolean := NOT boolean
Description
Operator. Precedence level 1. Invert the result of a relational expression.
Return Value
True if the inverted value is true, False if not.
enumeration := NotFound
Example
Syntax
([State: enumeration])
Description
Determine how a macro responds to a Not Found condition.
A Not Found condition is generally the result of a failed search. Create a Not Found condition with Assert(NotFoundCondition!).
Return Value
Off! Previous condition was Off!
On! Previous condition was On!
Parameters
State: enumeration (optional) Specify the Not Found state. The default is NotFound(On!). If missing, the current state is returned without changing it.
Off! Ignore a Not Found condition.
On! Stop a macro unless preceded by OnNotFound, which directs macro execution to a specified Label.
numeric := NthRoot
Syntax
(Value: numeric; Root: numeric)
Description
Get the Nth root of a value.
Example
Type(NthRoot (Value:100; Root:2))
// Return: 10.0
Return Value
Nth root of a value.
Parameters
Value: numeric The value (return the Nth root of).
Root: numeric The root to return.
string := NToC
Example
Syntax 1
(Character: numeric)
Description 1
Convert a number to its character equivalent.
Return Value 1
The character equivalent of an ANSI decimal value.
Parameter 1
Character: numeric The ANSI decimal value.
Example
Syntax 2
(CharacterOrCharSet: numeric; Character: numeric)
Description 2
Convert a number from a WordPerfect character set to its character equivalent.
Return Value 2
The character equivalent of a number in a WordPerfect character set.
Parameters 2
CharacterOrCharSet: numeric (optional) The number of a WordPerfect character set. If this parameter is not used, the default is 0 (ASCII set).
HardReturn! Insert a hard return character.
Hrt! Insert a hard return character.
Space! Insert a space character.
HardSpace! Insert a hard space character.
Tab! Insert a tab character.
HardPage! Insert a hard page break.
Hpg! Insert a hard page break.
ExtraLargeOn! Turn extra large text on.
ExtraLargeOff! Turn extra large text off.
VeryLargeOn! Turn very large text on.
VeryLargeOff! Turn very large text off.
LargeOn! Turn large text on.
LargeOff! Turn large text off.
SmallOn! Turn small text on.
SmallOff! Turn small text off.
FineOn! Turn fine text on.
FineOff! Turn fine text off.
SuperScriptOn! Turn superscript text on.
SuperScriptOff! Turn superscript text off.
SubScriptOn! Turn subscript text on.
SubScriptOff! Turn subscript text off.
OutlineOn! Turn outline text on.
OutlineOff! Turn outline text off.
ShadowOn! Turn shadow text on.
ShadowOff! Turn shadow text off.
BoldOn! Turn bold text on.
BoldOff! Turn bold text off.
ItalicsOn! Turn italics text on.
ItalicsOff! Turn italics text off.
UnderlineOn! Turn underline text on.
UnderlineOff! Turn underline text off.
DoubleUnderlineOn! Turn double underline text on.
DoubleUnderlineOff! Turn double underline text off.
RedlineOn! Turn redline text on.
RedlineOff! Turn redline text off.
StrikeOutOn! Turn strike out text on.
StrikeOutOff! Turn strike out text off.
SmallCapsOn! Turn small caps text on.
SmallCapsOff! Turn small caps text off.
Character: numeric The number of a character in a WordPerfect character set.
string := NToC
Example
Syntax
(Character: numeric)
Description
Convert a number to its character equivalent.
Return Value
The character equivalent of an ANSI decimal value.
Parameters
Character: numeric The ANSI decimal value.
string := NToC
Example
Syntax
(CharacterOrCharSet: numeric; Character: numeric)
Description
Convert a number from a WordPerfect character set to its character equivalent.
Return Value
The character equivalent of a number in a WordPerfect character set.
Parameters
CharacterOrCharSet: numeric (optional) The number of a WordPerfect character set. If this parameter is not used, the default is 0 (ASCII set).
HardReturn! Insert a hard return character.
Hrt! Insert a hard return character.
Space! Insert a space character.
HardSpace! Insert a hard space character.
Tab! Insert a tab character.
HardPage! Insert a hard page break.
Hpg! Insert a hard page break.
ExtraLargeOn! Turn extra large text on.
ExtraLargeOff! Turn extra large text off.
VeryLargeOn! Turn very large text on.
VeryLargeOff! Turn very large text off.
LargeOn! Turn large text on.
LargeOff! Turn large text off.
SmallOn! Turn small text on.
SmallOff! Turn small text off.
FineOn! Turn fine text on.
FineOff! Turn fine text off.
SuperScriptOn! Turn superscript text on.
SuperScriptOff! Turn superscript text off.
SubScriptOn! Turn subscript text on.
SubScriptOff! Turn subscript text off.
OutlineOn! Turn outline text on.
OutlineOff! Turn outline text off.
ShadowOn! Turn shadow text on.
ShadowOff! Turn shadow text off.
BoldOn! Turn bold text on.
BoldOff! Turn bold text off.
ItalicsOn! Turn italics text on.
ItalicsOff! Turn italics text off.
UnderlineOn! Turn underline text on.
UnderlineOff! Turn underline text off.
DoubleUnderlineOn! Turn double underline text on.
DoubleUnderlineOff! Turn double underline text off.
RedlineOn! Turn redline text on.
RedlineOff! Turn redline text off.
StrikeOutOn! Turn strike out text on.
StrikeOutOff! Turn strike out text off.
SmallCapsOn! Turn small caps text on.
SmallCapsOff! Turn small caps text off.
Character: numeric The number of a character in a WordPerfect character set.
Convert a number to a character string of numbers.
Return Value
A character string of numbers.
vText := NumStr(999; 0) // vText = "999"
vText := NumStr(3+7; 0) // vText = "10"
Parameters
Value: numeric A number or expression that results in a number.
RightDigits: numeric (optional) The number of digits to the right of the decimal returned as a character string. The range is 0-16. The default is 6. If the value of this parameter is greater than the number of decimal places, NumStr rounds up the entire expression. The decimal point returned by NumStr is defined by the sDecimal setting in the [intl] section of the Windows WIN.INI file.
LeftDigits: numeric (optional) This parameter is currently ignored. Default: Use as many digits as needed.