Jump to content

Rebol Programming/cvs-version

From Wikibooks, open books for an open world

USAGE:

[edit | edit source]
CVS-VERSION str 

DESCRIPTION:

[edit | edit source]

Converts CVS version number.

CVS-VERSION is a function value.

ARGUMENTS

[edit | edit source]
  • str -- (Type: any)

SOURCE CODE

[edit | edit source]
cvs-version: func [
    "Converts CVS version number." 
    str /local rev ver
][
    parse str [
        thru #":" copy ver to #"." skip 
        copy rev [to #"." | to #" "] 
        (
            rev: to-integer trim rev 
            ver: to-integer (to-integer trim ver) + (rev / 256) 
            rev: rev // 256 
            str: to-tuple reduce [ver rev]
        )
    ] 
    str
]