The Latest

DevX

Set Printer Margins

You can use the Printer’s scale properties to set margins. Set the properties so the position (0, 0) is mapped to where you want the margins. This code makes the

DevX

Make a Form Stay on Top

You can make a form always remain above others, even when it does not have focus. Use this code in a BAS module: #If Win16 Then Declare Sub SetWindowPos Lib

DevX

Perform One-Time Initialization

You can use static variables to perform one-time initialization: Private Sub GetValue()Static initialized As Boolean If Not initialized Then ‘ Perform one-time initialization. : initialized = True End If ‘

DevX

Use Explicit Object Types for Speed

It is much faster to use explicit object data types instead of generic ones. In this test that simply sets an object’s public variable, the generic object takes more than

DevX

Create Global Properties

You can create property procedures in a BAS module. The rest of your program treats the “property” like any other variable, but the property procedures can perform error checking and

DevX

Error ‘ASP 0115’

If you are developing in Visual Basic for Active Server Pages (ASP), there are two likely causes of an error ‘ASP 0115’. The VB5 setup wizard puts a number of

DevX

Hidden IP Address

One of the easiest ways to grab an IP address is to use request.servervariables(“REMOTE_ADDR”) and then store the value as a hidden field in your form. When the user submits

DevX

Creating Instance of InetAddress

InetAddress objects can be instantiated only by doing a hostname or address lookup by calling any one of the static lookup methods in the InetAddress. For example, to create an

DevX

Re-Throwing an Exception

An exception is thrown to indicate an abnormal state. The first handle to catch the exception can try to fix the problem. Should it fail to do that, or in

DevX

Returning Objects by Value

For efficiency reasons, large objects should usually be passed to or returned from a function by reference or by their address (using a pointer). There are, however, a few circumstances

DevX

Prefer Private Data Members to Protected Ones

Data members of a class are usually a part of its implementation rather than its interface. They may be replaced when the internal implementation of the class is to be

DevX

Use Multiple Inheritance to Conjoin Features

Derived classes can combine functionality of several base classes simultaneously, by means of multiple inheritance. Trying to achieve the same effect by using single inheritance can be very difficult, to

DevX

Local Classes

A class can be declared inside a function or a block. In such cases, it is not visible from anywhere else, and instances thereof can only be created within the

DevX

Sensing Browser Type

You can easily find out the browser type, version, and sometimes the operating system that your visitors are using by checking the userAgent and appVersion properties of the navigator object.

DevX

Prefer private data members to protected ones

Data members of a class are usually a part of its implementation rather than its interface. They may be replaced when the internal implementation of the class is to be

DevX

Microhelp and the Status Bar

Question: I’ve heard that the MDI Frame status bar can be subdivided so that multiple messages can be sent there. The only two methods of manipulating the status bar that

DevX

Using Animated GIF

Question: Can I use an animated GIF in my application? Answer: There is no simple way to use animated GIFs inside of PowerBuilder. However, there is a way that you

DevX

sql user name

Question: How can I find out the user name at SQL prompt. Answer: In SQL Server, you can write select user_name() Related Posts Embarcadero Unveils Indoor/Outdoor Application Proximity SolutionIDC Predicts

DevX

Tab Control

Question: I have a popup window with tab control (four tabs). I need to specify at open time which tab page gets control. It always opens tab 1 no matter

DevX

SQL and arrays of data

Question: I need to enter up to 1,600 measured data points into a SQL database. Each point makes one record. Is there a way to enter all of these records

DevX

Converting txt Files

Question: How can I import a delimited text file into a SQL Sever table? Answer: Welcome to the world of BCP. Included with SQL Server, the Bulk Copy Program will

DevX

Alwyas on Top

Question: How can you make your application “always on top,” just like the Windows clock application can? I use PB 4.0 and Windows 3.1. Answer: Use the SetPosition command to

DevX

Local External Functions

Question: Instead of distributing a user object (and its functions) as a PBD, I want to distribute it asa DLL (build runtime library, machine code),and then access its functionality in

DevX

Using ActiveX controls in PowerBuilder 6.0

Question: I would like to know how to find information(books, online documentation) on using ActiveXcontrols in PowerBuilder. Answer: I find the best way to learn how to use a new

DevX

Unmatched Query

Question: When one is working with large amounts of data, what is the quickest way of displaying rows not found when comparing two tables, without doing the following: SELECT table1.field1

DevX

Two lines of text in command buttons

Question: Is there a way to display the text on two lines with a command button in PowerBuilder 5? We have already tried the ~n. Answer: There is no way

DevX

Adding a JButton to the Cells of a Jtable

sing the Swing JTable class can quickly become a stickybusiness when you want to customize it to your specific needs. First you must become familiar with how the JTable class

DevX

The Trouble with Triggers, Part I

hat is a trigger? How does it work? When should one use them, and how does one debug them? Last, what are the enhancements that were made in SQL Server