You are currently browsing the PowerBuilder category

Splitting up a String or Text in SQL

Posted on September 9, 2011 at 8:15 pm in

Here is a way to split up a block of text and return a result set based on a delimeter. A table function is used to do the ‘heavy lifting’ and, utilizing some newer features of SQL Server (2005 and 2008), you can even join to it providing for even greater flexability. This situation I…

Splitting up a String or Text in SQL - the full story »

PowerBuilder ‘Gotcha’ – PixelsToUnits

Posted on September 7, 2011 at 8:20 pm in

From the Powerbuilder Help on this method: Converts pixels to PowerBuilder units. Because pixels are not usually square, you also specify whether you are converting the pixels’ horizontal or vertical measurement. Syntax PixelsToUnits ( pixels, type ) Argument Description pixels An integer whose value is the number of pixels you want to convert to PowerBuilder…

PowerBuilder ‘Gotcha’ – PixelsToUnits - the full story »

PowerBuilder – Reading Outlook Items

Posted on September 1, 2011 at 8:20 pm in

Here is some code which reads data from Outlook (2007 was tested) into PowerBuilder. You basically need to create a window with a multiline edit and a button on it. Put this into the clicked event of the button. To run it, open Outlook, select something (email message, task, etc.) then click the button on…

PowerBuilder – Reading Outlook Items - the full story »

PowerBuilder – Grid datawindow object with variable number of columns

Posted on August 17, 2011 at 8:20 pm in

Here is a way to build a grid datawindow which contains columns corresponding to an unknown number of data elements. You could use this approach in creating a project schedule, inventory location system, baseball box score, or any number of other examples. My example assumes the minimum number of columns to be four. This create…

PowerBuilder – Grid datawindow object with variable number of columns - the full story »

PowerBuilder – Selecting and scrolling to an entry in a Listview control

Posted on August 17, 2011 at 8:20 pm in

The listview control in PB lacks the capability to scroll to a highlighted item within the native Powerscript. Here is an easy way to do this by simulating key strokes. First declare the following API subroutine. keybd_event( int bVk, int bScan, int dwFlags, int dwExtraInfo) Library "user32.dll" Next create a user event in the listview…

PowerBuilder – Selecting and scrolling to an entry in a Listview control - the full story »

PowerBuilder – Folder Selection Dialog Window

Posted on June 23, 2011 at 8:20 pm in

Here is an NVO used to envoke a Windows folder selection dialog since PowerBuilder does not have it’s own version. You can change the API calls to ANSI for earlier versions of PB. I’ve had this squirreled away for awhile and I no doubt got it from someone else off the web. Thanks! // window…

PowerBuilder – Folder Selection Dialog Window - the full story »

PowerBuilder – Connect to SQLite version 3 database (ODBC)

Posted on June 14, 2011 at 8:20 pm in

If you are interested in doing PowerBuilder development with an SQLite database here is the DSN Less connection string to get you going. string ls_dbparm, ls_dbfile, ls_exepath, ls_file[] ls_dbfile = c:\temp\sqlite.db3' IF Fileexists(ls_dbfile) THEN // do nothing ELSE IF GetFileOpenName('Select Data File',ls_dbfile, ls_file,'db3','SQLite files (*.db3),*.db3') < 1 THEN Messagebox('No Data File Chosen','Application will close') HALT…

PowerBuilder – Connect to SQLite version 3 database (ODBC) - the full story »

PowerBuilder ‘Gotcha’ – Datawindow Column Alignments

Posted on June 9, 2011 at 8:20 pm in

I’ve been working quite a bit lately on the ‘tooltip’ type of functionality for datawindows. I encountered an issue today which gave me a bit of hassle until I worked it out. My technique looks at the width of the column and it’s position within the datawindow control to decide whether or not all the…

PowerBuilder ‘Gotcha’ – Datawindow Column Alignments - the full story »

PowerBuilder – Type ahead style dropdown datawindow columns

Posted on June 6, 2011 at 8:20 pm in

This type of functionality is one of those things which fills a gap so completely and perfectly that when you encounter some application (and almost all web pages) which doesn’t have it you groan to yourself. In the ancient past this was alternatively referred to as ‘Quicken style’ dropdowns since that application was one very…

PowerBuilder – Type ahead style dropdown datawindow columns - the full story »

PowerBuilder ‘Gotcha’ – Modify Parent Datawindow after a Getchild

Posted on May 27, 2011 at 8:20 pm in

If your window makes use of a datawindowchild for whatever reason remember that if you modify the parent datawindow the reference to the child will (most likely) be lost. In the PB Help it states: If a property causes this behavior, this is noted in its description in Chapter 3, “DataWindow Object Properties.” but I…

PowerBuilder ‘Gotcha’ – Modify Parent Datawindow after a Getchild - the full story »

Top