devxlogo

We are an award-winning tech entrepreneurship website where trusted experts can provide value globally.

Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.

devxlogo

Trusted for 26 years

Over 30K Articles

1M+ Readers

Expert-reviewed

10K+ Tech Terms

As seen in:

microsoft logo
business_insider_logo
wired_logo
berkley
arstechnica_logo
hackernoon

The Latest

Retrieve a List of Available Serial Ports

Here’s a nice little function that retrieves a list of the available serial ports on your system. Note that this function uses Java’s Communications API, also known as javax.comm, which

ForceTextBoxNumeric – Create a numeric Textbox

Private Declare Function GetWindowLong Lib “user32” Alias “GetWindowLongA” _ (ByVal hWnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib “user32” Alias “SetWindowLongA” _ (ByVal hWnd As

ForceTextBoxCase – Set a textbox’s upper/lowercase style

Private Declare Function GetWindowLong Lib “user32” Alias “GetWindowLongA” _ (ByVal hWnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib “user32” Alias “SetWindowLongA” _ (ByVal hWnd As

GetTempFile – Create a temporary file

Private Declare Function GetTempFileName Lib “Kernel32” Alias _ “GetTempFileNameA” (ByVal lpszPath As String, _ ByVal lpPrefixString As String, ByVal wUnique As Long, _ ByVal lpTempFileName As String) As LongPrivate Declare

ObjFromPtr – Return an object from its pointer

Private Declare Sub CopyMemory Lib “Kernel32” Alias “RtlMoveMemory” (dest As _ Any, Source As Any, ByVal bytes As Long)’ Returns an object given its pointer’ This function reverses the effect

Passing Named Arguments to Java Programs

Here’s an example of a better way to pass arguments to main() methods of Java classes than using String[] args. First, pass two named parameters, user and level, that come

Watch How You Use Your Booleans

With the introduction of the Boolean data type in VB4, you might be tempted to convert it to a numeric value using the Val function for storage in a database

Numeric Conversion of Strings

When dealing with numerics and strings, be advised of a couple “gotchas.” The Val() function isn’t internationally aware and will cause problems if you have users overseas. But you can’t

Simplify Boolean Variable Updates

Instead of using an If construct to set a Boolean variable, you can assign a Boolean variable to the result of any logical comparison. For example, instead of this code:

SQL Trick to Join Multiple Select Statements

Don’t overlook the UNION keyword in SQL as a way to simplify selections from multiple tables. For instance, to select the customer with the highest sales from three tables with

Hunt for Developers

Want to see a list of the developers who worked on VB5 and VB6? Try this: From VB’s View menu, select Toolbars, then Customize…. In the resulting dialog, click on

Keypress Won’t Fire When Pasting Into Text Box

Don’t put rules for validating text values or formats in the KeyPress event-use the Change event instead. If you “paste” into a text box, the KeyPress event isn’t fired and

Fast Copy of Properties between Controls

You probably already know that if you select multiple controls on a form you can use the Property Window to change one of their common property in one single operation.

Retrieve the list of SQL Server stored procedure

You can query SQL Server system tables to retrieve the list of all the stored procedure that are available for the end user and applications. The following routine extract their

Correctly restore mouse cursor

When you write lengthy procedures, it is a good habit to change the mouse cursor to an hourglass, and restore it to the original shape when the procedure exits. However,

The “Assume No Aliasing” compiler option

A procedure is said to contain aliased values if it can refer to the same memory addresses in two or more distinct ways. A typical example is the following procedure:

Vector vs. Array–the Best of Both Worlds

It’s often pointed out that the Vector class is expensive to use because all of the methods are synchronized. Java 2 has the LinkedList class, which can serve the same

Modifying Layout on Multiple Platforms

You can use the Toolkit’s getScreenSize().width to recompute the size of a component at run time. For example, if you have a Frame that is supposed to have the screen’s

Using NULL in a Query’s Where Clause

While comparing a field to NULL, a SQL query should use the IS operator in place of the “=” operator. The reason is that if the ANSI_NULLS option is On