ProvatoSys   
w w w . P r o v a t o S y s . c o m
M i c h a e l   C a t a l a n i
9 0 1 . 5 8 1 . 8 7 9 1

 

Pic    Services    Contact    Code    Tips


Programming

The following code is supplied as-is.  Please test and verify all code as to its function. Most all code supplied is in free format, utilizing Version 6 of the operating system.


Programming


Updated April, 2009

Screen

This Page shows how to retrieve the current screen size mode, and how to code your popup windows so that they will display correctly. If you've ever displayed a popup window over an existing screen, only to have the existing screen blanked out, it could have been because your popup window is not set to the same screen size mode as the existing window. IE: the existing screen is in 27 x 132 size, and the popup window is 24 x 80.

I have packaged the screen size mode detection code into a function called Screen_SizeIs27x132 in a service program called Screen_S.  This function returns true ( on ) if the display size is currently 27 x 132, else it returns off.

if Screen_SizeIs27 x 132;
  do some code
endif; 

 


popup calendar 
Updated April, 2009   ** New Feature - Auto Position Window

popup screen

This Page contains a pop up calendar program. The program is available in two ways: A) in simply a quick program that can be compiled and B) in a function within a service program.

An example of using the program would be:                

Calendar( OrderDate );

An example of using the Calendar function would be:

OrderDate = Calendar_PopUp( %date );

 

Some of the features of this pop up calendar are:

 


Solar 
    Updated October, 2010 

** DOWNLOAD NOW AVAILABLE
     Restores back to V5R3M0

This Page contains a service program which can calculate the Sunrise, Sunset, Solar Noon, and Length of Day for any place on Earth.  An example of the call to retrieve the sunrise time would be:

       SunRiseTime = Solar_GetSunriseTime(   SunRiseDate
                                                                          : Latitude
                                                                          : Longitude
                                                                          : HourOffset
                                                                          : DayLightSavings );


Dates


    Updated March, 2009

 

This Page contains a service program that contains date functions, such as returning the day of the week name, the year begin and year end date for a given date, the start and end dates for a month for a given date, the number of days in a year, the current day number of the year, and string concatenation functions to return the date in a string of words.

For instance, if the system date is 03/11/2009, then the below functions would return the following:

Date_DayOfTheWeek( %date );            returns the day name of the week  ie: 'Thursday'

Date_DayToString(  %date );                returns "March 11th, 2009"

Date_DateToStringWithDay( %date );   returns  "Wednesday, March 11th, 2009"

Date_DateOfTheYear( %date );              returns  70


Time  
     Updated March, 2009

 

This Page contains a service program that contains time functions, such as sleeping for microseconds, delaying a job until a certain time, and returning the time in a string of words.

An example of one of the functions in the service program:

Time_TopOfTheHour( %time );            returns the top of the hour time.  IE if the passed time is 05:32:45, the function returns 06:00:00.


Math


   Updated March, 2009

 

This Page contains a service program which contains the math functions such as sine, cosine, tngent, cotangent, etc.  These are wrapped in a service program so that you wont have to bind to the QC2LE directory in your application, the service program does this automatically.  There are also some custom  functions included, such as converting Radians to Degrees and Degrees to Radians.


Objects 
   Updated February, 2009


This page contains a service program which utilizes the QUSROBJD api.  Included bundled in this service program are functions that returns an objects size, description, asp#, etc. You can quickly create new functions in a coupe of minutes to access any of the data supplied by the QUSROBJD function .  It makes accessing this data as easy as coding:

AspNumber = Object_RetrieveObjectAsp( ObjectName : ObjectLibrary : ObjectType );

 


Numbers


     Updated February, 2009


This Page contains a service program which contains a function called Number_NumberToWords.  This function will return the word phrase of a number. The field may be as large as 20 digits, with 5 decimal places.

Example:

WordPhrase = Number_NumberToWords( 69452 );

The value of the WordPhrase field would be " sixty nine thousand four hundred fifty two "

You can also specify an optional parameter to place a comma into the string.

WordPhrase = Number_NumberToWords( 5422346 : 'Y' );

The value of the WordPhrase field would be " five million, four hundred twenty two thousand, three hundred forty six"