Klik op het logo voor hulp op afstand
  
 
 
 
 
 
 
 




Scripting Function Reference F


 

Fatal ([S])

JoPPS/JCALL/JScripter

 

Aborts the execution of the script and raises an runtime error #51.

î      S is an optional user-defined errormessage.

 

7     Example:

 

word := START("word.application");

IF !IsIDispatch(word) THEN Fatal("WORD did not start !");

 

&    For more information refer to 2.6. Stopping script execution.

 

FileAge (Sfn) : Ddatetime

JoPPS/JCALL/JScripter

 

Returns the date-and-time stamp of the specified file.

î       Sfn is the name of the file

ì       Ddatetime is the date-and-time stamp of the file. You can use the date-time conversion and formatting routines on the returned value.

 

&     GetFileDate, SetFileDate, DateToStr, DateTimeToStr, FormatDateTime

 

M     Returns FALSE if the file was not found.

 

FileExists (Sfn) : B

JoPPS/JCALL/JScripter

 

 Checks if a given file exists. Available in Jopps 2.84 P2

 

FileLength (Dh) : D

JoPPS/JCALL/JScripter

 

Returns the total length in bytes of a file.

î       Dh is the filehandle of the file.

ì       The total length of the file in bytes.

 

&     FilePos

 

FilePos (Dh) : D

JoPPS/JCALL/JScripter

 

Returns the current file pointer position of a file.

î       Dh is the file handle of the file.

ì       The position of the file pointer from the beginning of the file in bytes.

 

&     FileLength

 

FileSearch (Sspec,Sdirlist) : S

JoPPS/JCALL/JScripter

 

Searches for a given file in a list of directories.

î       Sspec is the name of the file to search for. Sdirlist is the list of subdirectories to search. The directory paths in Sdirlist must be separated by semicolons.

ì       The returned value is a concatenation of one of the directory paths and the filename, or an empty string if the file could not be located.

 

M     Returns an empty string if the file could not be found !


&     FileExists

 

FileToStr (Sfn) : S

JoPPS/JCALL/JScripter

 

Reads a textfile into a string variable.

î       Sfn is the name of the textfile to read.

ì       Returns a S-type value holding the contents of the file.

 

M     Returns an empty string if the file cannot be read.

 

&     StrToFile

 

FileType (Dh) : D

JoPPS/JCALL/JScripter

 

Returns the type of a file.

î       Dh is the filehandle representing the file.

ì       Returns one of the following constants :

Filetype constants

Meaning

FILETYPE_UNKNOWN

The type of  the file is unknown.

FILETYPE_DISK

The file is a disk file.

FILETYPE_CHAR

The file is a character file, typically a LPT device or a console.

FILETYPE_PIPE

The file is either a named or anonymous pipe.

 

FLOOR (D) : D

JoPPS/JCALL/JScripter

 

Returns the highest integer less than or equal to the given value.

î       D-type value to be rounded.

ì       Returns the rounded value.

 

7     Example :

FLOOR(-2.8)     returns -3
FLOOR(2.8)                  returns 2
FLOOR(-1.0)     returns -1

&     CEIL


FlushKbd ()

JCALL

 

Empties the keyboard buffer. (standard console input stream)

&     KeyPressed, KeyIn

 

FormatDateTime (Sformat,Ddatetime) : S

JoPPS/JCALL/JScripter

 

Formats a given date-and-time value using the format string given.

î   Sformat is the date-and-time format string,

    Ddatetime is the date-and-time value. (eg. returned by Now)


    Format strings :

    c                Displays the date using the ShortDate (Windows regional settings) format,
                      followed by the time in LongTime (Windows regional settings) format.
                      The time is not displayed if the fractional part of the Ddatetime value is zero.
    d                Displays the day as a number without a leading zero (1-31).
    dd              Displays the day as a number with a leading zero (01-31).
    ddd            Displays the day as an abbreviation (Sun-Sat).
    dddd          Displays the day as a full name (Sunday-Saturday) .
    ddddd        Displays the date using the ShortDate (Windows regional settings) format.
    dddddd      Displays the date using the LongDate (Windows regional settings) format.
    m                Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier,

                       the minute rather than the month is displayed.
    mm             Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier,

                      the minute rather than the month is displayed.
    mmm          Displays the month as an abbreviation (Jan-Dec).
    mmmm       Displays the month as a full name (January-December).
    yy               Displays the year as a two-digit number (00-99).
    yyyy Displays the year as a four-digit number (0000-9999).
    h                Displays the hour without a leading zero (0-23).
    hh              Displays the hour with a leading zero (00-23).
    n                Displays the minute without a leading zero (0-59).
    nn              Displays the minute with a leading zero (00-59).
    s                Displays the second without a leading zero (0-59).
    ss              Displays the second with a leading zero (00-59).
    t                Displays the time using the ShortTime (Windows regional settings) format.
    tt               Displays the time using the LongTime (Windows regional settings) format.
    am/pm       Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon,

                      and 'pm' for any hour after noon.

                     The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
    a/p             Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon,

                      and 'p' for any hour after noon.

                     The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
    /                Displays the date separator character.
    :                Displays the time separator character.
    'xx'/"xx"     Characters enclosed in single or double quotes are displayed as-is, and do not affect formatting.

 

ì       The formatted string.

7     Example :


msg := FormatDateTime('"It is today " dddd, mmmm d, yyyy, ',Now(NOW_DATE));

            OutputMsg(msg);

 

&     DateToStr, TimeToStr, Now

 

FormatStr (Sformat,D) : S

FormatStr (Sformat,S) : S

JoPPS/JCALL/JScripter

 

Formats a D-type or S-type variable using the format string S.

î   Sformat is the format string,

    The D- or S-type parameter is used as the argument for the formatter.

    Format strings :

    Format strings contain two types of objects--plain characters and a format specifier. Plain characters are copied verbatim to the resulting string.

    The format specifier uses the second argument to apply formatting to. A format specifier can have the following form :


    "%" [index ":"] ["-"] [width] ["." prec] type
    A format specifier begins with a % character. After the % come the following, in this order :
    An optional argument index specifier, [index ":"]
    An optional left justification indicator, ["-"]
    An optional width specifier, [width]
    An optional precision specifier, ["." prec]
    The conversion type character, type; which should be compatible with the second argument given :

    a) the second argument is of the S-type :  FormatStr(Sformat,S):S

         s          String. The argument must be a character, a string, or a PChar value.

                     The string or character is inserted in place of the format specifier. The precision specifier,

                     if present in the format string, specifies the maximum length of the resulting string.

                     If the argument is a string that is longer than this maximum, the string is truncated.

 

     b) the second argument is of the D-type :  FormatStr(Sformat,D):S


         e          Scientific. The argument must be a floating-point value.

                     The value is converted to a string of the form "-d.ddd...E+ddd". The resulting string starts with a

                     minus sign if the number is negative. One digit always precedes the decimal point.

                     The total number of digits in the resulting string (including the one before the decimal point)

                     is given by the precision specifier in the format string--a default precision of 15 is assumed if no precision specifier is present.

                     The "E" exponent character in the resulting string is always followed by a plus or minus sign and at least three digits.

          f           Fixed. The argument must be a floating-point value. The value is converted to a string of the form "-ddd.ddd...".

                     The resulting string starts with a minus sign if the number is negative.

                     The number of digits after the decimal point is given by the precision specifier in the format string--a default of 2 decimal digits

                     is assumed if no precision specifier is present.

          g          General. The argument must be a floating-point value.

                      The value is converted to the shortest possible decimal string using fixed or scientific format.

                      The number of significant digits in the resulting string is given by the precision specifier in the format string--a default precision

                      of 15 is assumed if no precision specifier is present.

                      Trailing zeros are removed from the resulting string, and a decimal point appears only if necessary.

                      The resulting string uses fixed point format if the number of digits to the left of the decimal point in the value

                      is less than or equal to the specified precision, andif the value is greater than or equal to 0.00001.

                      Otherwise the resulting string uses scientific format.

           n         Number. The argument must be a floating-point value. The value is converted to a string of the form "-d,ddd,ddd.ddd...".

                      The "n" format corresponds to the "f" format, except that the resulting string contains thousand separators.

           m         Money. The argument must be a floating-point value. The value is converted to a string

                       that represents a currency amount.

                      The conversion is controlled by the Windows regional settings.


ì       The formatted string.

FUN(Dfunid)

JoPPS – V2.82

 

This function is a alias for SelectEditorFunction.

&     SelectEditorFunction

 

î        Sfn is the name of the file to check. This function allows the use of wildcards (*,?).

î       Dattr is an optional parameter to specify the file attributes for the file to check. The possible values are:


Value

Meaning

ATTR_READONLY

Look for files with the ReadOnly attribute set

ATTR_HIDDEN

Look for files with the Hidden attribute set

ATTR_SYSFILE

Look for files with the System File attribute set

ATTR_VOLUMEID

Look for VolumeID files

ATTR_DIRECTORY

Look for Directories

ATTR_ARCHIVE

Look for files with the Archive attribute set (typical for zip files)

ATTR_SYMLINK

 

ATTR_ANYFILE

Look for any file

 

 

ì       Returns TRUE if the file exist.

 

&    DirExists, FileSearch, FileExists




 |  History  |
 
 

 
 
 
TECHWIN SOFTWARE
De Regenboog 11
B-2800 Mechelen
T +32(0)15 44 64 64
T +31(0)30 899 32 15 Nederland