WOY()

WOY()

Gets the week number of the year.

Syntax

      WOY( <dDate>, <lIso> )  --> nWeek

Arguments

<dDate> A valid date.

Returns

<nWeek> The week number <lIso> Flag that indicates if <nWeek> is in ISO format.

Description

This function returns the week number of the year for a given date. It returns the week number in ISO format ( range 0 – 52, by default or passing TRUE as second parameter) or 1 – 52 if lIso is FALSE.

Examples

      ? WOY( hb_SToD( "20000131" ) ) // -> 3
      ? WOY( hb_SToD( "20000131" ), .F. ) // -> 4

Compliance

This function is new in Harbour.

Platforms

All

Files

Library is libmisc

Seealso

DOY()

TTroff()

TTroff()

Troff Class

Syntax

      oTroff:=TTrof():New(<cFile>) --> oTrf

Arguments

<cFile> Name of the Troff file to create

Returns

<oTrf> instance of the TTroff Class

Description

TTroff() is a class that creates the TROFF Documentation Source Code of the same name you pass to the constructor.

The class methods are as follows:

New(<cFile>) Create a new instance of the THtml class Close() Close the created file

WriteTitle(<cTopic>, <cTitle>) Write the file title

WritePar(<cPar>) Write a paragraph

WriteParBold(<cPar>) Same as WritePar(), but the text is bold

WriteLink(<cLink>) Write a link to another topic

WriteText() Writes text without formating

Examples

      PROCEDURE Main()
         LOCAL oTroff

         oTroff := TTroff():New( "tr\harbour.ngi" )
         oTroff:WriteTitle( "Harbour Reference Guide" )
         oTroff:WritePar( "HARBOUR" )
         oTroff:WriteLink( "OverView" )
         oTroff:WriteLink( "License" )

         oTroff:WritePar( "See the Links Above" )
         oTroff:Close()

         RETURN

Compliance

This is a new Harbour Tools class

Platforms

ALL

Seealso

TNortonGuide()

TRtf()

TRtf()

Rtf Class

Syntax

      oNg:=TRtf():New(<cFile>) --> oRtf

Arguments

<cFile> Name of the RTF file to create

Returns

<oRtf> An instance of the TRtf Class

Description

TRtf() is a class that creates the RTF Documentation Source Code of the same name you pass to the constructor.

The class methods are as follows:

New(<cFile>) Create a new instance of the TRtf class

Close() Close the create file

WriteTitle(<cTopic>, <cTitle>) Write the file title

WritePar(<cPar>) Write a paragraph

WriteParBold(<cPar>) Same as WritePar(), but the text is bold

WriteLink(<cLink>) Write a link to another topic

WriteHeader() Write the RTF header

EndPar() Write the end paragraph delimiter

Examples

      PROCEDURE Main()
         LOCAL oRtf

         oRtf := TRtf():New( "rtf\harbour.rtf" )
         oRtf:WriteHeader()
         oRtf:WriteTitle( "Harbour Reference Guide" )
         oRtf:WritePar( "HARBOUR" ):Endpar()
         oRtf:WriteLink( "OverView" )
         oRtf:WriteLink( "License" )

         oRtf:WritePar( "See the Links Above" ):EndPar()
         oRtf:Close()

         RETURN

Compliance

This is a new Harbour Tools class

Platforms

ALL

Seealso

TNortonGuide()

TOs2()

TOs2()

OS/2 Documentation Class

Syntax

      oNg:=TOs2():New(<cFile>) --> oOs2

Arguments

<cFile> Name of the IPF Source file to create

Returns

<oOs2> An instance of the TOs2 Class

Description

TOs2() is a class that creates the OS/2 IPF Source of the same name you pass to the constructor.

The class methods are as follows:

New(<cFile>) Create a new instance of the TOs2 class

Close() Close the created file

WriteTitle(<cTopic>, <cTitle>) Write the file title

WritePar(<cPar>) Write a paragraph

WriteParBold(<cPar>) Same as WritePar(), but the text is bold

WriteLink(<cLink>) Write a link to another topic

ScanLink(<clink>) Scan the aLinkRef array for a valid topic

DosToOs2Text(<cText>) Convert a Dos string to a OS/2 String

Examples

      PROCEDURE Main()
         LOCAL oNg

         oNg := TOs2():New( "ngi\harbour.ngi" )
         oNg:WriteTitle( "Harbour Reference Guide" )
         oNg:WritePar( "HARBOUR" )
         oNg:WriteLink( "OverView" )
         oNg:WriteLink( "License" )

         oNg:WritePar( "See the Links Above" )
         oNg:Close()

         RETURN

Compliance

This is a new Harbour Tools class

Platforms

ALL

Seealso

TNortonGuide()

TNortonGuide()

TNortonGuide()

Norton Guide Class

Syntax

      oNg:=TNortonGuide():New(<cFile>) --> oNg

Arguments

<cFile> Name of the Ng Source file to create

Returns

<oNg> An instance of the TNortonGuide Class

Description

TNortonGuide() is a class that creates the Norton Guide Source Code of the same name you pass to the constructor.

The class methods are as follows:

New(<cFile>) Create an instance of the TNortonGuide class

Close() Close the created file

WriteTitle(<cTopic>, <cTitle>) Write the file title

WritePar(<cPar>) Write a paragraph

WriteParBold(<cPar>) Same as WritePar(), but the text is bold

WriteLink(<cLink>) Write a link to another topic

Examples

      PROCEDURE Main()
         LOCAL oNg

         oNg := TNortonGuide():New( "ngi\harbour.ngi" )
         oNg:WriteTitle( "Harbour Reference Guide" )
         oNg:WritePar( "HARBOUR" )
         oNg:WriteLink( "OverView" )
         oNg:WriteLink( "License" )

         oNg:WritePar( "See the Links Above" )
         oNg:Close()

         RETURN

Compliance

This is a new Harbour Tools class

Platforms

ALL

Seealso

TTroff(), TRtf(), THtml(), TOs2()

THtml()

THtml()

Html Class

Syntax

      oHtml:=THtml():New(<cFile>) --> oHtm

Arguments

<cFile> Name of the Html file to create

Returns

<oHtm> An instance of the THtml Class

Description

THtml() is a class that creates an .html file of the same name you pass to the constructor.

The class methods are as follows:

New(<cFile>) Create a new instance of the THtml class

Close() Close the created file

WriteTitle(<cTitle>) Write the file title

WritePar(<cPar>) Writes a paragraph

WriteParBold(<cPar>) Same as WritePar(), but the text is bold

WriteLink(<cLink>, <cName>) Write a link to another topic

WriteText(<cText>) Write any text

Examples

      PROCEDURE Main()
         LOCAL oHtm

         oHtm := THTML():New( "www\harbour.html" )
         oHtm:WriteTitle( "Harbour Reference Guide" )
         oHtm:WritePar( "HARBOUR" )
         oHtm:WriteLink( "OverView" )
         oHtm:WriteLink( "License" )
         oHtm:WriteLink( "http://www.gnu.org/copyleft/gpl" )
         oHtm:WritePar( "See the Links Above" )
         oHtm:Close()

         RETURN

Compliance

This is a new Harbour Tools class

Platforms

ALL

Seealso

TCLASS()

Harbour Check Functions

Check Functions

IsAffirm Checks if passed char is an affirmation char
IsAlpha Checks if leftmost character in a string is an alphabetic character
IsBin Check if the value is a Binary Number
IsDec Check if the value is a Decimal Number
IsDigit Checks if leftmost character is a digit character
IsDisk Verify if a drive is ready
IsHexa Check if the value is a Hexal Number
IsLeap Tests if a specific year is a leap year
IsLeapYear Checks if the given date is a leap year
IsLower Checks if leftmost character is an lowercased letter
IsNegative Checks if passed char is a negation char
IsOctal Check if the value is a Octal Number
IsUpper Checks if leftmost character is an uppercased letter.
HB_Is_CStructure Checks if the value is a CStructure
HB_IsArray Tests if the value returned by an expression is an array
HB_IsBlock Tests if the value returned by an expression is a Code block
HB_IsByRef Tests if a parameter is passed by reference
HB_IsChar Tests if the value returned by an expression is char type
HB_IsDate Tests if the value returned by an expression is a Date
HB_IsDateTime Tests if the value returned by an expression is a DateTime value
HB_IsEvalItem Undocumented
hb_IsFunction Determine wheter exists (linkable) a function
HB_IsHash Tests if the value returned by an expression is a Hash
HB_IsHashKey Tests if the value returned by an expression is a Hash Key
HB_IsLogical Tests if the value returned by an expression is a logical value
HB_IsMemo Tests if the value returned by an expression is a Memo value
HB_IsNil Tests if the value returned by an expression is NIL
HB_IsNull Tests if the value returned by an expression is empty
HB_IsNumeric Tests if the value returned by an expression is a numeric value
HB_IsObject Tests if the value returned by an expression is an object
HB_IsPointer Tests if the value returned by an expression is a pointer
hb_IsPrinter ( Probably ) same as IsPrinter()
hb_IsRegex Determine is this value a regular expression
hb_IsRegexString Checks if a character string is a compiled regular expression
hb_IsService Undocumented
HB_IsString Checks if the value is a string
HB_IsSymbol Checks if the value is a symbol
HB_IsTimeStamp Checks if the value is a TimeStamp

StrFormat()

StrFormat()

Format a string

Syntax

      StrFormat(<cMask>[, <cPar1>[, <cParn>[, ...]]) --> cString

Arguments

<cMask> Holds the mask for the resulting string

<cParn> Holds the strings to be inserted in the mask maximum 9 of them can be specified.

Returns

<cString> Return the mask with all the parameters inserted.

Description

String replacment, can be useful when writing international apps. You can separate the constant strings from the variable ones. Each %1 – %9 marks will be replaced with the appropriate parameter from the parameter list.

Marks can be in any order, and can be duplicated.

You can print “%” character with “%%”.

Examples

      StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" )
      StrFormat( "This is %1 from %2", "Victor", "Hungary" )
      StrFormat( "%2 %1 %2", "Param1", "Param2" )

Tests

      ? StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" )
      ? StrFormat( "This is %1 from %2", "Victor", "Hungary" )
      ? StrFormat( "%2 %1 %2", "Param1", "Param2" )
      ? StrFormat( "Hello" )
      ? StrFormat( "%1 - %2", "one" )
      ? StrFormat( "%1 - %2", "one", "two" )
      ? StrFormat( "%2 - %1", "one", "two" )
      ? StrFormat( "%2 - %", "one", "two" )
      ? StrFormat( "%% - %", "one", "two" )
      ? StrFormat( "%9 - %", "one", "two" )

Compliance

All platforms

Files

Library is libmisc

Seealso

Transform(), Stuff(), StrTran()

OctalToDec()

OctalToDec()

Converts a Octal Value to Decimal

Syntax

      OctalToDec(<cN>) -><cNr>

Arguments

<cN> number to be converted

Returns

<cNr> number converted

Description

This function converts a string <cN> from an octal value to a numeric decimal value.

Files

Library is libmisc

Seealso

BinToDec(), HexaToDec()