fmShowErrors

Purpose:

When Show Errors is turned on, any problems that occur while processing NeoFM/FTP actions will be displayed to the user in the form of error messages. When turned off no messages are displayed. When Show Errors is turned off, you can obtain the most recent error is by examining the global [FMFTP.Error] variable. Show Errors is set to on automatically when NeoFM/FTP is initialized.

Category:

Miscellaneous

Syntax:

fmShowErrors "status"

status

The status of the Show Errors feature. Use "Yes" to turn Show Errors on or "No" to turn it off.

Example:

When Show Errors is turned off you can check the global [FMFTP.Error] variable to detect important errors and respond if needed. For example:


fmShowErrors "No"

fmCreateFolder "Local1" "Backup"

If "[FMFTP.Error]" ">" ""

  AlertBox "Sorry" "Unable to create folder."

EndIf

fmShowErrors "Yes"


In addition to the normal error trapping provided by the [FMFTP.Error] variable, you can also create an error subroutine called FMFTP_Error to execute special actions whenever an error occurs. For example, the following subroutine beeps annoyingly whenever an FM/FTP error is detected:


:FMFTP_Error

  PlayTone "440"

Return


You should avoid executing FM/FTP plug-in actions from within this subroutine! Doing so could cause your publication to become stuck in an endless loop.


fmTranslateStrings

Purpose:

Customize or translate strings used by File Browser, confirmation dialog boxes, progress bars and other NeoFM/FTP features. These settings affect all connections, even those that have not yet been opened.

Category:

Miscellaneous

Syntax:

fmTranslateStrings "strings"

strings

This is a compound parameter and can contain any combination of the following items:


Property

Description

Default Value

CopyFile=value

value = prompts used by the copy/move confirmation dialog.

Copy File

CopyFolder=value

"

Copy Folder

MoveFile=value

"

Move File

MoveFolder=value

"

Move Folder

FileOverwritePrompt=value

"

There is already a file with the same name in this location.

FolderOverwritePrompt=value

"

There is already a folder with the same name in this location.

FileReplacePrompt=value

"

Would you like to replace the existing file

FolderReplacePrompt=value

"

Would you like to replace the existing folder

ReplaceWithPromt=value

"

With this one?

DateModified=value

"

Date modified

Yes=value

"

Yes

YesToAll=value

"

Yes to All

No=value

"

No

NoToAll=value

"

No to All

Cancel=value

"

Cancel

Resume=value

"

Resume (if applicable)

Error=value

value = prompts used by the copy conflict error dialog.

Error

FileConflictPrompt=value

"

There is already a file with the same name in this location.

FolderConflictPrompt=value

"

There is already a folder with the same name in this location.

Skip=value

"

Skip

Copying=value

value = prompts used by the progress dialog.

Copying

Moving=value

"

Moving

Recycling=value

"

Recycling

Deleting=value

"

Deleting

Renaming=value

"

Renaming

Extracting=value

"

Extracting

Confirm=value

value = prompts used by the delete confirmation dialog.

Confirm

RecycleOne=value

"

Are you sure you want to move this item to the Recycle Bin?

DeleteOne=value

"

Are you sure your want to permanently delete this item?

RecycleMultiple=value

(%s will be replaced with the number of items affected.)

Are you sure you want to move these %s items to the Recycle Bin?

DeleteMultiple=value

"

Are you sure you want to permanently delete these %s items?

OK=value

"

OK

StatusBarText=value

value = text that appears in the File Browser's status bar. (%t will be replaced with the total number of items and %s with the number of selected items.)

Items: %t, Selected: %s




Bytes=value

value = captions that appear in the File Browser's header.

Bytes

Name=value

"

Name

Size=value

"

Size

Type=value

"

Type

Modified=value

"

Modified

Attributes=value

"

Attributes

TotalSize=value

"

Total Size

FreeSpace=value

"

Free Space


Separate multiple items in a compound parameter with semicolons (;). Items that do not need to be translated can be omitted.

Example:

The following example will translate the strings used for the File Browser's header into Italian:


fmTranslateStrings "Name=Nome;Size=Dimensione;Type=Tipo;Modified=Modifica;Attributes=Attributi"


fmSetDragDropOptions

Purpose:

Configure the global default options used for all drag and drop operations.

Category:

Miscellaneous

Syntax:

fmSetDragDropOptions "options"

options

This is a compound parameter and can contain any combination of the following items:


DefaultAction=value

This option defines the default action to take when dropping files onto a File Browser. Value can be one of the following:


Copy

Dropped files will be copied unless the Ctrl key is pressed then the files will be moved. (This is the default.)

Move

Dropped files will be moved unless the Ctrl key is pressed then the files will be copied. (This is the method used by Windows Explorer.)


GetConfirmation=yes/no

Yes = display a confirmation dialog before overwriting any existing files. No = do not display a confirmation dialog.


Note: The confirmation dialog provides users with the opportunity to OK or cancel file operations that would overwrite existing files. The confirmation dialog can be customized using the fmTranslateStrings action, or replaced entirely with something of your own design (see Special Subroutines).


ShowProgress=yes/no

Yes = Display the progress window. No = do not display the progress window.


Note: The progress window provides feedback to the user about the status of the extraction process. It also provides the user with an option to abort the procedure before completion. The progress window can be customized using the fmTranslateStrings action, or replaced entirely with something of your own design (see Special Subroutines).


AllowResume=yes/no

Yes = Allow resume for FTP downloads. If a confirmation dialog is displayed, it will contain a check box allowing users the option of enabling or disabling the Resume feature. No = Do not allow resume to be used.


Note: Resume can be useful when a download is interrupted before completion. Resume allows you to continue a download from where it left off rather than starting over. Resume can only be used with binary transfer mode and must be supported by the FTP server. This option only affects files copied from an FTP server to a local drive.


Separate multiple items in a compound parameter with semicolons (;).

Example:

fmSetDragDropOptions "DefaultAction=Copy;GetConfirmation=Yes;ShowProgress=Yes"


fmSetDelimiter

Purpose:

Set the global delimiter to be used for all NeoFM/FTP actions that require one. The global delimiter is used to separate multiple items in variables. The default global delimiter is the semicolon (;) character.

Category:

Miscellaneous

Syntax:

fmSetDelimiter "delimiter"

delimiter

The delimiter character that will be used to separate multiple items in a variable.

Example:

The following example sets the global delimiter to a carriage return, requests a list of selected files and displays the results in an AlertBox:


fmSetDelimiter "[#13]"

fmFileListToVar "FileList1" "FullPath=No;IncludeFiles=Yes;IncludeFolders=No; SelectedOnly=Yes" "[Files]"

AlertBox "Hello" "The selected files are:||[Files]"



fmCHMODNumToPermStr

Purpose:

Convert a numeric permission (CHMOD) to a permission string. For example, the numeric permission "755" would be converted to "rwxr-xr-x". This is primarily useful when getting or setting permissions for files and folders located on a remote/FTP server.

Category:

Miscellaneous

Syntax:

fmCHMODNumToPermStr "number" "variable"

number

The numeric permission to be converted.

variable

The name of the variable where the converted permission will be stored.

Example:

fmCHMODNumToPermStr "755" "[PermStr]"


fmPermStrToCHMODNum

Purpose:

Convert a permission string to a numeric permission (CHMOD). For example, the permission string "rwxr-xr-x" would be converted to "755". This is primarily useful when getting or setting permissions for files and folders located on an FTP server.

Category:

Miscellaneous

Syntax:

fmPermStrToCHMODNum "string" "variable"

string

The permission string to be converted.

variable

The name of the variable where the converted permission will be stored.

Example:

fmPermStrToCHMODNum "rwxr-xr-x" "[PermNum]"


fmNumToSizeStr

Purpose:

Convert a file size number into a formatted string. The size will be formatted to include a thousands separator (if necessary) and reduced to the nearest gigabyte, megabyte, kilobyte or byte. For example:


Size

After Formatting

2449948672

2.28 GB

3634290

3.47 MB

11828

11.55 KB

108

108 Bytes

Category:

Miscellaneous

Syntax:

fmNumToSizeStr "size" "variable"

size

The file size number to be formatted.

variable

The name of the variable where the formatted file size will be stored.

Example:

fmNumToSizeStr "1024" "[SizeStr]"