NeoFM/FTP allows you to open multiple file system connections. Each connection automatically creates some unique connection-specific status variables that contain important status information that you can access from VisualNEO Win. Each status variable is a combination of the Connection ID, a period (.) and a special keyword. Since NeoFM/FTP allows you to open multiple connections and tables at the same time, this method makes it unlikely that any two connections will have conflicting status variable names.


Status variables may be inserted wherever normal VisualNEO Win variables are accepted. For example, after calling fmConnectLocal, we can display an alert box to report the total number of files and folders in the current directory using the [TotalItems] variable:


fmConnectLocal "MyPC" "C:\Program Files"

AlertBox "Report" "There are [MyPC.TotalItems] items in the current directory."


You could also display the number of the items on screen by adding the [MyPC.TotalItems] variable to a VisualNEO Win Text object. For example:



Status variables are read-only, meaning that they can be displayed but not modified using the SetVar or any other action commands. Instead use NeoFM/FTP actions like fmChangeDir, fmSelectAll, fmSelectSome, etc. when you want to make changes to the status of a connection or file browser.


Below is a list of status variables created automatically by NeoFM/FTP. Replace "ID" with your Connection ID.


[ID.Status]

The connection's status. For local connections this variable will always contains the word "Connected". For remote connections, this variable will contain either "Connected" or "Disconnected" depending on the status of the connection.


Note: When you close a connection with fmDisconnect all status variables for that connection are deleted. Generally, the only time the [ID.Status] variable will contain "Disconnected" will be if the FTP server closes the connection prematurely.

[ID.CurrentDir]

The connection's current directory.

[ID.TotalItems]

The total number of items (files and folders) found in the current directory. Actions like fmSetFileMask can affect the count, so this number may be different than the actual number of files.

[ID.Selcount]

The number of items in the current directory that have been selected. Items can be selected or unselected programmatically using actions like fmSelectAll, or interactively by the user using a visual file browser.

[ID.FileMask]

The connection's current file mask/filter. A file mask is a string that specifies the type of file or files that will be visible to the connection. The mask may include multiple file types including wildcard characters. Use the fmSetFileMask action to change the file mask.

[ID.Log]

For remote connections only, this variable contains a log of messages sent to and from the FTP server. You can use the fmConnectRemote action's LogLimit option to limit the size of the log.


In addition, NeoFM/FTP also creates some unique generic variables that contain important information. Unlike the connection specific status variables above, generic variable always start with "FMFTP." instead of a connection ID. Many generic variables are task specific and only exist during certain activities such as drag and drop operations. Some generic variables are read-write, meaning that they can be modified programmatically to abort or change the outcome of certain operations.


Below is a list of generic variables created for automatically by NeoFM/FTP:


[FMFTP.ActiveClient]

The Connection ID of the file browser considered to be "active". This variable allows you to determine which file browser is active when more than one file browser is open at the same time. You can pass this variable to actions such as fmCopySelected.

[FMFTP.Error]

The most recent error message. This variable is useful for trapping errors when fmShowErrors is turned off.


The following variables are intended to be used in conjunction with Special Subroutines:


[FMFTP.DropTarget]

During drag and drop operations, this variable contains the target path were dragged items would be copied or moved when the mouse button is released. This variable only exists when the target is one of NeoFM/FTP's file browsers. This information is not available when dragging files to external applications.

[FMFTP.EventType]

This variable may contain one of the following:


FileDrop

Files have been dropped onto a file browser.

ConfirmCopy

ConfirmMove

NeoFM/FTP is requesting confirmation before completing a copy or move operation.

CopyConflict

A copy conflict error has occurred. This usually means that an invalid copy or move operation has been attempted.

RightClick

The user has clicked on a file browser's list view using the right mouse button.

DoubleClick

The user has double clicked on a file browser's list view.


[FMFTP.EventSourceID]

[FMFTP.EventDestID]

During a file drop or copy/move confirmation operation, these variables contain the Connection ID's belonging to the source and destination file browsers.

[FMFTP.EventSourceFile]

During a file drop operation, this variable contains a list of files to be dropped separated by the global delimiter.


During a copy/move confirmation, this variable contains the name of the source file that triggered the confirmation request.


During a copy conflict error, this variable contains the name of the source file that triggered the conflict.


During a right click or double click event, this variable will contain the name of the file underneath the mouse pointer.

[FMFTP.EventDestFile]


(drag and drop operations only)

During a file drop operation, this variable contains the destination path where the dropped files will be copied or moved.


During a copy/move confirmation, this variable contains the name of the destination file that will be overwritten if the request is OK'd.


During a copy conflict error, this variable contains the name of the destination file that triggered the conflict.

[FMFTP.EventResult]

During a file drop operation, this variable cab be set to one of the following values:


Copy

Dropped files will be copied.

Move

Dropped files will be moved.

Cancel

Abort the drop operation.


During a copy/move confirmation, this variable can be set to one of the following values:


Yes

The destination file that triggered the request will be overwritten.

YesToAll

The destination file that triggered the request will be overwritten and future confirmation requests will be automatically answered with "Yes".

No

Do not overwrite the destination file.

NoToAll

Do not overwrite any destination files.

Cancel

Abort the entire copy/move operation.


During a copy conflict error, this variable can be set to one of the following values:


Skip

Skip the file that triggered the conflict and continue the rest of the copy/move operation.

Cancel

Cancel the entire copy/move operation.

[FMFTP.EventResume]

During a download/copy confirmation, this variable can be set to "True" to allow Resume to be used if a copy of the file already exists in the destination folder. This variable will be ignored unless the "AllowResume" option has been enabled in the fmCopySelected, fmCopyFrom or fmSetDragDropOptions actions.

[FMFTP.EventMessage]

During a copy conflict error, this variable will contain the text describing the error.

[FMFTP.ProgressCaption]

The caption displayed at the top of the progress bar window.

[FMFTP.ProgressMax]

The total number of items to be processed by the progress bar.

[FMFTP.ProgressCount]

The number of items processed so far by the progress bar.

[FMFTP.ProgressFile]

The name of the current item being processed by the progress bar.

[FMFTP.ProgressFileSize]

The total size in bytes of the current file being processed by the progress bar. This variable is only used when coping files.

[FMFTP.ProgressFileBytesCopied]

The number of bytes of the current file that have been processed so far. This variable is only used when coping files.

[FMFTP.ProgressAbort]

During an operation involving the progress bar, this variable can be set to "True" to abort the current operation. This has the same effect as clicking the progress bar's "Cancel" button.


Indicates variable can be modified. All other variables should be considered read-only.