January 27, 2004

Create Folders Using the File Sytem Object Model

Creating folders with the file system object model can help eliminate errors and long folder-existence checks?especially if you are attempting to create already existing folders. Dim fso as new FileSystemObjectDim fldr as FolderOn Error Goto FolderError’foldername is the name of the folder you wish to’create passed by value into this

Sorting a STL Sequential Container of Pointers

Say you have a user structure and a container of pointers to that user structure. You need to sort the container based only on some structure’s members. The solution is to define the structure’s specific function objects less and greater and to pass to the sort algorithm the appropiate function

Build Output Using the Ant <tstamp/> Task

When you execute , it generates the local ANT macros ${TSTAMP} and ${DSTAMP}. These are the time and date as numeric strings. They can then be used to dynamically generate timestamp strings. Here is an example in a simple ANT buildfile that generates a timestamped jarfile: The above build.xml outputs

Dynamically Create a Sortable Column

Sometimes you need your resultset sorted a particular way and using the primary key doesn’t accomplish what you need. One way to get around this is to create a sortable column dynamically in your query using the CASE function. SELECT name, title, priority =(CASE titlewhen ‘President’ then 1 when ‘Vice

Frequently Asked Questions

DevX Account Maintenance I can’t remember my DevX username and/or password. Can you tell me what it is? How can I update my account information? Newsletters How can I subscribe or unsubscribe to newsletters? How can I view and manage which newsletters I am currently subscribed to?Programming Support Does DevX

DevX Help

How do I…? Look up my password Subscribe/Unsubscribe/Manage Newsletters Download or access code and articles Submit articles to DevX for publication Get programming help Update my magazine subscription Edit or update my DevX account information: email us at [email protected] Check out our Frequently Asked Questions? For more questions and answers

A SQL Split Function

This SQL function is similar to the VB split function. It takes a nvarchar delimeted list and delimeter and returns a table with the values split on delimeter. if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UTILfn_Split]’) and xtype in (N’FN’, N’IF’, N’TF’))drop function [dbo].[UTILfn_Split]GO create function dbo.UTILfn_Split( @String