Tuesday, December 18, 2007

Blinking Text

Published by CybTech at 4:25 PM

This is a very simple but very effective trick. You will need to set the timer interval of the datawindow to something, I set it to 10. You will find the timer by double clicking on any blank part of the datawindow.

Next place a text field on the datawindow (or any control) goto the attributes dialog. Then in the visible attribute place this code:

if( Mod( Integer( Mid( String( Now() ), 7, 2 ) ),2 ) = 1,0,1)

It is also possible to make the text change colours by using similar code in the color attribute:

if( Mod( Integer( Mid( String( Now() ), 7, 2 ) ),2 ) = 1,0,255)

Sort, Filter and Query Dialogs

Published by CybTech at 4:07 PM

The datawindow is the work horse of PowerBuilder, when you have been using it for a while it is easy to forget some of the basic but very powerful built-in function of the Datawindow.


Sort
You can specify the default sort sequence of the datawindow using a cool drag and drop style response window, but you may not know that with two or three simple commands you can offer the same dialog window to users of your application:

String ls_Null

SetNull( ls_Null )
dw_1.SetSort( ls_Null )
dw_1.Sort()


Filter
The filter is a great function for showing users slices of the data making the screen less cluttered and making large amounts of data easier to deal with. Well the filter dialog window is also available to your users:

String ls_Null

SetNull( ls_Null )
dw_1.SetFilter( ls_Null )
dw_1.Filter()

Query Mode
Query mode is a great feature for higher power users. It allows them to alter the where clause by entering arguments into the Datawindow columns. For example whilst in query mode the user could enter >500 to show all employees who's hourly rate was over 500 dollars. And if there are any companies out there who want to pay me 500 dollars an hour send me an email :). Anyway enough fantasy, the user only extends the original where clause so you can add a few basic joins and limits to the SQL to they don't bring the server down. You can also query the Where clause so see what they altered it to and maybe offer some ability to save their queries for future use. This code is based in the clicked event of a checkbox to allow the user to toggle the query mode:

IF NOT this.checked THEN
dw_1.Modify("DataWindow.QueryMode=YES")
ELSE
dw_1.Modify("DataWindow.QueryMode=NO")
dw_1.Retrieve()
END IF

Capturing Date and Time from Oracle Database Server

Published by CybTech at 3:48 PM

global type server_date from function_object
end type

forward prototypes
global function datetime server_date ()
end prototypes

global function datetime server_date ();datetime dfr
select sysdate
into :dfr
from dual;
return dfr

end function

Watch TV - Live online internet televisionAccess to 4000 live TV stations from your pc. No need of a TV tuner or decoder. 100% legal - no subscription needed.

Watch television channels online anywhere. All you need is our software, your pc, and Internet connection. Thousands of television shows that would cost you big money in the long run with traditional TV providers, now can watch them with no subscription. Watch 4000 TV Stations from Over 80 Countries!

Cartoons, Fashion, News, Discovery, Sport, Movies, Music, Football, Adult Shows, Weather, Stocks, Educational, and many others channels are available.

You can watch TV to your PC or laptop at any time and anywhere in the world since our service is not affected by regional terrain or weather.

This webtv software does not contain any spyware or advertise modules. It has safety installation with NO WORRIES concerning valuable information loss.

WATCH TV NOW. LIMITED TIME OFFER.