fm.version.major ( )

Function stats

Average user rating
37
422
9999
Support
FileMaker 8.0 +
Date posted
23 May 2019
Last updated
23 May 2019
Version
Recursive function
No

Author Info
 Fabrice

79 functions

Average Rating 4.4

author_avatar



 

Function overview

Prototype

fm.version.major  ( _applicationVersion )


Parameters

_applicationVersion  Pro Advanced version (leave empty for current app version)


Description

returns the major version number for a software (typically FileMaker) version as a number
fm.version.major ( "17.0.3" ) -> 17
if _applicationVersion is empty, uses get ( applicationversion )
Works on all systems, wether they use . or , as decimal separator.

Examples

Sample input

fm.version.major ( "17.0.3" )
fm.version.major ( "" )


Sample output

17
18 (if current app version is 18.0.1)

 

Function code

/* fm.version.major ( _applicationVersion )

by Fabrice Nordmann, 1-more-thing

Jan 2019

returns the major version number for a software (typically FileMaker) version as a number
fm.version.major ( "17.0.3" ) -> 17
if _applicationVersion is empty, uses get ( applicationversion )
Works on all systems, wether they use . or , as decimal separator.

*/


Let ([
    _v = Case ( IsEmpty ( _applicationVersion ) ; Get ( ApplicationVersion ) ; _applicationVersion ) ;
    _v = Substitute ( Filter ( _v ; "1234567890." ) ; "." ; " " ) ;
    _v = LeftWords ( _v ; 1 )
];
    GetAsNumber ( _v )
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/422

    Prototype: fm.version.major( _applicationVersion )
    Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
    Last updated: 23 May 2019
    Version: 1.1

*/
// ===================================