Harbour Extensions

Harbour Extensions

Harbour Extensions

Description

Language extensions:

* Class generation and management.

CA-Cl*pper only allowed creation of objects from a few standard classes.

In Harbour, you can create your own classes–complete with Methods, Instance Variables, Class Variables and Inheritance. Entire applications can be designed and coded in Object Oriented style.

* @<FunctionName>()

Returns the pointer (address) to a function.

The returned value is not useful to application-level programming, but is used at a low level to implement object oriented coding. (Internally, a class method is a static function and there is no symbol for it, so it is accessed via its address).

* Class HBGetList

Object oriented support for GetLists management.

* ProcName() support for class Method names.

Class Methods can be retrieved from the call stack.

* Memory() has new return values.

See hbmemory.ch

* Transform() –> new function in format string

@0 Make a zero padded string out of the number.

* SToD() –> dDate

New function that converts a yyyymmdd string to a Date value.

* Optional Compile Time STRONG TYPE declaration (and compile time TYPE MISMATCH warnings)

Example: LOCAL/STATIC Var AS …

* The Harbour debugger provides new interesting classes:

– Class TDbWindow could be the foundation for a generic multiplatform

– Class TForm

– Class TDbMenu implement both pulldown and popup menus.

RTL enhanced functionality:

– Directory( <cMask>, <cFlags>, <lEightDotThree> )

The 3rd parameter is a Harbour (optional) parameter and indicates that on those platforms that support long filenames, that you wish to receive what would be considered the dos equivalant 8.3 name. Could affect Adir() and Dir if they were modified to take advantage of it – currently, they will return long names if the os supports it.

– HB_DiskSpace( <nDrive>, <nType> )

The second parameter is a Harbour (optional) parameter and indicates the type of diskinfo being requested. See en/diskspac.txt for info.

SP Date Functions

 DATECALC()     Adds/subtracts days,weeks,months,years to a date
 DTOW()         Converts date to words
 STOD()         Returns date from string in the form YYYYMMDD
 WOYEAR()       Calculates week of the year (# of 7 day periods)
 DTDIFF()       Returns difference between dates
 DAYSIN()       Calculates number of days in a month
 BOYEAR()       Determine beginning of year a date falls in
 BOM()          Calculates beginning of the month date
 DOYEAR()       Calculates day of the year from date
 SETCENT()      Determines if century is on/off
 WOMONTH()      Calculates week of the month (# of 7 day periods)
 BEGEND()       Determines beginning or end of week,month or quarter
 SET_DATE()     Sets and restores date format

SP_STOD

STOD()

  Short:
  ------
  STOD() Returns date from string in the form YYYYMMDD

  Returns:
  --------
  <dDate> => date from string

  Syntax:
  -------
  STOD(cStringDate)

  Description:
  ------------
  Returns date from string of the form YYYYMMDD
  <cStringDate>

  Examples:
  ---------
   cStrdate := "19890102"

   dNewdate := STOD(cStrdate)

   // (returns 01/02/89 type date)

  Source:
  -------
  S_STOD.PRG

 

CT_SToD

 


 STOD()
 Converts an ANSI date string into Clipper format

 Syntax

     STOD(<cAnsiDate>) --> dDate

 Argument

     <cAnsiDate>  Designates the character string that contains a date in
     the ANSI format "YYYYMMDD" that is to be converted into the Clipper
     date format.

 Returns

     STOD() returns the <cAnsiDate> character string in the corresponding 
     Clipper date format.

 Description

     STOD() converts an ANSI date created by the Clipper DTOS() function,
     back into the standard date format.

 Note

     .  If the ANSI date is invalid, a null date is returned.

 Example

     Display the ANSI date in default date format:

     APPEND FROM OTHDATE
     LIST STOD(cAnsiDate)

 

Tools — Date/Time Functions

Introduction Date/Time Functions
ADDMONTH()   Adds or subtracts months to/from a date
BOM()        Determines the date of the first day of a month
BOQ()        Determines the date for the beginning of a quarter
BOY()        Determines the date for the beginning of a year
CTODOW()     Converts the day of the week name into a corresponding number
CTOMONTH()   Converts the name of the month into a corresponding number
DMY()        Returns a date in "DD Month YY" format
DOY()        Determines the day of the year for a specific date
EOM()        Determines the date for the last day of a month
EOQ()        Determines the date for the end of a quarter
EOY()        Determines the date for the end of the year
ISLEAP()     Tests if a specific year is a leap year
LASTDAYOM()  Determines the number of days in a month
MDY()        Returns a date in the "Month DD, YY" format
NTOCDOW()    Changes the number of a weekday into a weekday name
NTOCMONTH()  Changes the number of a month into a month name
QUARTER()    Determines the quarter in which a specific date lies
SECTOTIME()  Converts seconds into a time string
SETDATE()    Sets the system date
SETTIME()    Sets the system clock
SHOWTIME()   Continuously displays the time at desired screen position
STOD()       Converts an ANSI date string into Clipper format
TIMETOSEC()  Calculates the seconds since midnight
TIMEVALID()  Determines whether a specified time is valid
WAITPERIOD() Pauses a specified time in increments of 1/100 seconds
WEEK()       Returns the calendar week for a date
WOM()        Returns the week within a month.