 here are some assorted Functions for calling in programs...

 DOW - Day of Week. SURPRISE...
       Returns a String of the Day of the Week.
       you may send 2 parameters to the function to determine the
       day of week method of return...
       Omitting the Second parameter automatically returns the Abreviated
       Version.
       Date Field must be LONG
       Return Value must be String

       SYNTAX -  Pre:SomeDayString = DOW(Date,'A') ! returns Mon for monday
                 Pre:SomeDayString = DOW(Date,'L') ! returns Monday
                 Pre:SomeDayString = DOW(Date)     ! returns Mon


MOY - Month of year....
      Sometimes it is just the Month name that you want to return.
      this can take two Parameters also.
      DATE - must be Long.
      Type - A for Abreviated , L for long (defaults to A if omitted)

      SYNTAX  Pre:SomeMonthString = MOY(DAte,'A') ! returns Jan for January
              Pre:SomeMonthString = MOY(Date,'L') ! returns January
              Pre:SomeMonthString = MOY(Date)     ! returns Jan

QuarterYear - Quarter of Year

   Returns The number of the Quarter that the date falls into
   Since not all Companies or goverment entities use jan 1 as the
   start of the fiscal year a second parameter is available for
   start of fiscal year.

   The Function has 2 parameters SearchDate,fiscalDate

   SearchDate is the date to be caclulated
   FiscalDate is the start of the Fiscal Year (Optional)
              if fiscal date is ommitted the calculations are based
              on Jan 1 of the same year as sent in Searchdate

  Date Fields must be LONG
  Return Value is Short

   SYNTAX -  Pre:Quarter = QuarterYear(SearchDate,fiscalDate)
             pre:Quarter = QuarterYear(SearchDate)


DaysEOY - number of days till end of year.

   Returns The number of days till End of Year
   The Function has 1 parameters SearchDate
   SearchDate is the date to be caclulated this is optional
              if the searchdate is ommitted the date will default
              to today

   Date must be long
   Return value is short


   SYNTAX  - pre:NumberDays = DaysEoy(Date)
             pre:NumberDays = DaysEoy()



DaysBetween - Incusive number of days between dates

   Returns The number of days Between dates
   The Function has 2 parameters CalcDate1,DateEnd
   CalcDate is the date to be caclulated

   Date2 is the date to be searched to( optional).
         If the date is omitted the date will default to today

   Date Fields are LONG
   Return Value is SHORT

   SYNTAX -  PRe:NumberDays = DaysBetween(date,date)
             PRe:NumberDays = DaysBetween(date)


SinceBOY - Returns the number of days since the Begining of Year.(Short)

   Returns The number of days since the first of the year......
   The Function has 1 parameters CalcDate
   CalcDate is the date to be caclulated if Omitted the date will default
            to today()

   Date Field is LONG
   Return value is SHORT

   SYNTAX    NumberDays = SinceYear(Date)


CADATE - Returns a string containing the Date Format DD-MMM-YYYY

   Returns a Valid Date string for RDB CA type The date format for CA is
   DD-MMM-YYYY
   The Function has 1 parameters ParDate1
   ParDate1 is the date to be Converted

   Date Field is LONG
   Return value is STRING

   SYNTAX    GoodDate = CaDate(Date)


RDATE- Returns a True or False for validity of date range sent to Function       

   The Function has 3 parameters ParDate1,ParDate2,ParDate3

   ParDate1 is the date to be checked in range
   ParDate2 is the LowRange of date
   ParDate3 is the Highrange date check

   Date Fields are LONG
   Return Value is BYTE

   SYNTAX    Pre:GoodDate = RDATE(Date,LowDate,HighDate)



BDATE - Returns the Next Business date (Monday-Friday)
        Somtimes in Scheduling you need to insure that the Date chosen is
        the next business date.. or even to warn the user that it is not.
        This takes 2 parameters 2nd one is optional and returns a LONG(DAte)

        Date - Date to send to function LONG
        Number of days - Variable SHORT or constant (optional)

        Returns A LONG

        SYNTAX - Pre:SomedateField = Bdate(Date,NoDays)
                 Pre:SomedateField = Bdate(Date)



CCalendar - Returns the Date Selected for User.
            This allows you to verify that the date entered is a valid date
            or get the user to choose a valid date.
            Date - Date to start (optional) LONG

        SYNTAX - Pre:SomedateField = Ccalendar(Date) !returns a Long
                 Pre:SomedateField = Ccalendar() !returns a Long


Calculator - Calculator function for calculations
             Allows the user or you to pre-send an amount to the calculator
             or call the function to calculate amounts.
             This can take up to 2 parameters

             Amount    - Amount to send to Function - REAL
             Precision - Number of Decimal Places (max 6), Short

            SYNTAX - Pre:SomeRealField = Calculator()
            SYNTAX - Pre:SomeRealField = Calculator(Amount)
            SYNTAX - Pre:SomeRealField = Calculator(Amount,Places)


MessageBox - Allows a 64k string to be displayed on screen.
             Message box will allow sending of a memo or string field
             to the procedure for information.
             the system allows you to write as much text as necessary and
             will parse it out into 60 char chunks and display it into a
             QUEUE structure.
             This will take two parameters.

             Title string - must at least send '' for blank.
             MessageString - 64k max string or memo.

             SYNTAX - Messagebox('','this is some string')
             SYNTAX - Messagebox('this is a title','this is some string')
             SYNTAX - Messagebox('this is a title',somestring)
             SYNTAX - Messagebox(TitleString,MemoField)


QUESTIONBOX - Returns the number of the choice selected.(Byte)

  Question Box Library
  Allows Message to be sent of any length including Memos
  this is setup to be displayed in an queue array and shown on the Screen
  this function will allow up to 4 prompts for button selections.

  SYNTAX - Resultfield = QuestionBox(Title,Message,ButtonChoice,ButtonChoice,ButtonChoice,ButtonChoice)
           Resultfield = QuestionBox(Title,Message,ButtonChoice,ButtonChoice,ButtonChoice)
           Resultfield = QuestionBox(Title,Message,ButtonChoice,ButtonChoice)
           Resultfield = QuestionBox(Title,Message,ButtonChoice)
           Resultfield = QuestionBox(Title,Message)

  You may Check the Result of the Question Box in Number format

          Execute ResultField
            do Procedure               ! Return 1st Button in Array
            do Procedure               ! Return 2st Button in Array
            do Procedure               ! Return 3st Button in Array
            do Procedure               ! Return 4st Button in Array
            do Procedure               ! Return Exit Button
          End!Execute
       End!If

 The Exit Button will be the last choice always... If you send 3 buttons
 and the user exits the result for exit will be 4.




to Include this in your System .....

    2 Ways....
     In the MAP structure of the Main.Tpl file (Clarion.tpl, or Super.tpl)
     Add in the Include File Just above the %ModuleStructures Line.

                   INCLUDE('hLib.Inc')
    Press CTRL_O in your app. press Alt_G In the Global Source Code section
    Access the embed structure for GLOBAL MAP.
    add the Line

                   INCLUDE('hLib.Inc')


    Insure that you have the DLL's in the Clarion3 subdirectory and the LIB's
    in the Clarion3\Lib Directory.
    The Hlib.Inc must be somewhere in the PATH. (Generally place it with the
    DLL's)

    When Ready to Process PRess CTRL_P to access the PRoject.
    Access CHANGE PROJECT FILE, MODULES, AND ADD (INSERT),
    %clapfx%hlib.lib , (insure that you check the External obj/lib)

   IF confused check how %clapfx%descla21.lib or one of the others and
   Make it match.

    Hope you enjoy...

    Andy Stapleton <<cowboy>>
    Stallion Systems Consulting
    (405) 794-7997 /Office/Fax
    (405) 794-0832 BBS

    CS:ID 75110,2467

