BoY()

BoY()

Date to find first day of year, default is DATE()

Syntax

       BoY( [<dDate>] ) -> dDateBeginOfYear

Argument

[<dDate>] : Date to find first day of year, default is DATE()

Returns

<dDateBeginOfYear> : Beginning date Of year of given date

Example

       PROC MAIN()
          SETMODE( 25, 80 )
          CLS
          SET DATE GERM
          SET CENT ON
          ? "Today is :", DATE()
          ? "Date of first day of this year :", BOY()
          ? "Days elapsed in the current year:", DATE() - BOY()
          ?
          WAIT "EOF BoY.prg"
       RETURN // MAIN

Compliance

BoY() is compatible with CT3’s BoY()

Platforms

All

Files

Library is hbct.

See also

BoM(), EoM(), BoQ(), EoQ(), EoY()

BoQ()

BoQ()

Date of beginning Of quarter containing given date

Syntax

       BoQ( [<dDate>] ) -> <dDateBeginOfQuarter>

Argument

[<dDate>] : Date to find Begin Of Quarter, default is DATE()

Returns

<dDateBeginOfQuarter> : Date of beginning Of quarter containing given date

Example

       PROC MAIN()
            SETMODE( 25, 80 )
            CLS
            SET DATE GERM
            SET CENT ON
            ? "Today is :", DATE()
            ? "Beginning day of this quarter :", BOQ()
            ? "Days elapsed in the current quarter :", DATE() - BOQ()
            ?
            WAIT "EOF BOQ.prg"
         RETURN // MAIN

Compliance

BoQ() is compatible with CT3’s BoQ()

Platforms

All

Files

Library is hbct.

See also

BoM(), EoM(), EoQ(), BoY(), EoY()

BoM()

BoM()

Beginning date Of Month of given date

Syntax :

      BoM( [<dDate>] ) -> <dDateBeginOfMonth>

Argument :

[<dDate>] : Date to find first day of month, default is DATE()

Returns :

<dDateBeginOfMonth> : Beginning date Of Month of given date

Examples

       PROC MAIN()
          SETMODE( 25, 80 )
          CLS
          SET DATE GERM
          SET CENT ON
          ? "Today is :", DATE()
          ? "Date of first day of this month :", BOM()
          ? "Days elapsed in the current month:", DATE() - BOM()
          ?
          WAIT "EOF BOM.prg"
       RETURN // MAIN

Compliance

BoM() is compatible with CT3’s BoM().

Platforms

All

Files

Library is hbct.

See also

EoM(), BoQ(), EoQ(), BoY(), EoY()

BitToC()

BitToC()

Converts position-dependent bits into characters

Syntax

       BITTOC(<nInteger>,<cBitpattern>,[<lMode>])
               --> <cBitString>

Arguments

<nInteger> Designates a number in the range of 0 to 65535, which corresponds to a bit pattern.

<cBitpattern> Designates a character string with a maximum of 16 characters. Each character corresponds to a bit in <nInteger>, where the last character corresponds to the lowest-value bit.

<lMode> When this optional parameter is designated as .T., 0 bits change to blanks. The default is no change.

Returns

The returned string contains the corresponding characters passed by the bit pattern.

Description

The BITTOC() function changes the bits of a number into a sequence of corresponding characters. This facilitates work with such bit-coded information as file attributes. Depending on the <lMode> logical parameter (the l in lMode symbolizes logical), 0 bits either displays no character (.F.) or a blank (.T.).

Note

. If <lMode> is designated as .T., the string length that results always corresponds to <cBitpattern>.

Examples

       .  Change file attributes:
           .  The number 2 corresponds to a binary "00000010":
              ? BITTOC(2, "ADVSHR")            // "H" as the next to
                                               // last character
           .  The number 5 corresponds to a binary "00000101":
              ? BITTOC(5, "ADVSHR")            // "SR"
           .  The number 5, with the 0 bit displayed as a blank:
              ? BITTOC(5, "ADVSHR", .T.)       // "   S R"

Files

Source is numconv.prg, library is libct.

See also

CTOBIT() CTON()