if (lnameStrc.pos[1] NEQ 0)

-----Original Message-----
From: Jamie Jackson [mailto:[EMAIL PROTECTED]]
Sent: donderdag 31 januari 2002 18:19
To: CF-Talk
Subject: Proper way to check for successful subexpression match?


Hi,

What needs to be in place of "whatGoesHere" in the following code
block? I'd like to know the proper way to determine whether or not my
subexpression was matched. If you just refer to the structure elements
pos and len, when there is no match, CF throws an error.

// find pattern and return subexpressions
lNameStrc = refind('([^         ]+)$', name, 1, 'true');

// if subexp was found, set var. otherwise set var to bogus val
if (whatGoesHere???) {
 lName = mid(name, lnameStrc.pos[2], lnameStrc.len[2]);
} else {
 lName = '1029384756XXX';
}


______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to