The Latest

DevX

Encapsulate Your Code

One of the most common mistakes developers can make is to extensively use global variables. While they are sometimes necessary, global variables can cause problems in code that are both

DevX

Changing Style Attributes Dynamically

Microsoft’s IE4 supports the ability to change just about any CSS1 style attribute dynamically. To access an element’s style, use the style object property that corresponds to the style attribute.

DevX

Comparing Textbox Values Regardless of
Case

If you want to compare the values in two different textboxes, and you don’t want case to be a factor in whether or not the values are equivalent, you can

DevX

Generating Random Numbers in Any Range

VBScript’s random number generator, Rnd, only generates random numbers between 0 and 1. If you need numbers in a different range, use the following formula: Int ((UpperBound – LowerBound +

DevX

Changing Two Frames With One Click

When you create a Web site that includes frames, you can easily use a hyperlink in one frame to change the contents of a second frame. But you may frequently

DevX

Preventing a Browser From Caching a Web Page

Each browser has its own way of managing whether or not a page is cached. You can prevent a browser from caching a Web page programmatically by setting the Response.Expires

DevX

Enhancing Browser Page Loading Performance

If your ASP application is experiencing browser page loading performance problems, you may want to consider implementing one or both of the following techniques. First, a fairly easy way to

DevX

Simple JavaScript Alphabet

One obvious way to display or filter large recordsets is alphabetically. This function will take a page file and an optional frame name (defaults to _self) and create a row

DevX

Create a Link That’s Really a Function Call

You can call a function from a link, instead of opening a new location, by assigning the function to the anchor tag’s href attribute, like this: Click here Notice that

DevX

How to Pass a Variable into Report

Question: When I use a datawindow to generate a custom report, how can I pass a variable into the report from an input field? Answer: You can do this through

DevX

“Out of Memory” Error

Question: About halfway through compiling a 32-bit EXE with PB 6.5 on Windows NT, I keep getting an “out of memory” message box and then another that says “DDE Server

DevX

SQL Comments

Question: Can I insert comments inside a SQL query, like &#47&#42 &#42&#47 and &#47&#47in C++? Answer: SQL supports &#47&#42 and &#42&#47 for comments inside stored procedures and queries. You also

DevX

Performance of Joined Tables

Question: I have several tables with the same structure and I’m trying to combine them all into one unique table. But I’m worried about performance because each table has a

DevX

IIS Applications

Question: When I try to create a new IIS app,I receive an error message: “IIS or peer web services 3.0 or latermust be installed,” but IIS is installedand running on

DevX

Different Versions Coexisting on Same Machine

Question: Can three versions of PB (5.0, 6.5, and 7.0) coexist on the same machine without any problems? Answer: I am running PB5.0.4, PB6.5, and PB7.0.1 on my home and

DevX

Determining Variable Length

Question: How do I test the number of ‘characters’ contained within a given variable? Answer: Try this: Debug.Print “Length: ” & Len(CStr(X)) Once you convert a variable to a string,

DevX

ADO Events

Question: How do I use the ADO events FetchProgress or FetchComplete? Answer: If you want to use these, they work just like other events generated by other objects. When you

DevX

Insert Column into Table

Question: What is the proper syntax to insert a column into an existing SQL table? Answer: Here’s the syntax to add a column to a table: ALTER TABLE Employees ADD

DevX

Accessing Multiple Databases from a Datawindow

Question: Using a single datawindow, can I access data from multiple databases (Oracle and Sybase)? If not, can I use PowerBuilder to access it without having any intermediate table? Answer:

DevX

The unique() Algorithm

STL’s unique() algorithm eliminates all but the first element from every consecutive group of equal elements in a sequence of elements. unique() takes two forward iterators, the first of which

DevX

Signed Bit Fields

A bit field can be signed or unsigned. According to the C++ standard, a signed bit field may be represented in one of three ways: two’s complement one’s complement sign

DevX

Creating Immutable Constants

Although usually I don’t recommend using macros in C++ code, there are a few exceptions. One such exception is when you want to create a truly immutable constant. Consider the

DevX

Undoing a Macro

If you happen to define an object or a function or a constant whose name collides with a macro located elsewhere in a third-party header file, as in: // file

DevX

Take Advantage of Open Source Products

Open source products come with their source code files. Although you can usually install a ready-made executable file, you want to take advantage of the available source code files and