syntax error in expressions structure

ColdFusion 9

Hi. I am working with some ColdFusion sample code supplied by, and I am getting what looks like a syntax error. Here is the error:

Invalid CFML construct found on line 55 at column 41.
ColdFusion was looking at the following text:
The CFML compiler was processing:
    An expression beginning with (, on line 55, column 22.This message is usually caused by a problem in the expressions structure.
    A cfset tag beginning on line 55, column 2.
The error occurred in C:/websites/ line 55
53 : <!--- Because coldfusion's ListToArray object ignores empty fields, we must
54 : put a null in all empty fields to make sure that they are not skipped --->
55 : <cfset post_response=(cfhttp.filecontent, "||", "|null|", "all")>
56 : <!--- the same command is run twice, because the first time it only adjusts
57 : every other empty field --->

Open in new window

Here is the code ... I will include what seems relevant to the error, but please let me know if you need the entire form:

Name:        RegisterConference.cfm
Author:      EB
Description: 1) process information for conference registrants; 2) populate payment page with data entered in the registration form
Created:     July 2014
Revised: August 2014
ColdFusion Version 9
MS SQL Server 2012

<!--- stuff--->

<cfset paymentConfirmed="">

<cfhttp method="Post" url="">

	<!--- the API Login ID and Transaction Key must be done with valid values --->
	<cfhttpparam type="Formfield" name="x_login" value="xxxxxxxx">
	<cfhttpparam type="Formfield" name="x_tran_key" value="yyyyyyyValue">
	<cfhttpparam type="Formfield" name="x_delim_data" value="TRUE">
	<cfhttpparam type="Formfield" name="x_delim_char" value="|">
	<cfhttpparam type="Formfield" name="x_relay_response" value="FALSE">
	<cfhttpparam type="Formfield" name="x_duplicate_window" value="30">
	<cfhttpparam type="Formfield" name="x_type" value="AUTH_CAPTURE">
	<cfhttpparam type="Formfield" name="x_method" value="CC">
	<cfhttpparam type="Formfield" name="x_card_num" value=#cardNumber#>
	<cfhttpparam type="Formfield" name="x_exp_date" value=#cardDate#>
	<cfhttpparam type="Formfield" name="x_card_code" value=#cardCCV#>

	<cfhttpparam type="Formfield" name="x_amount" value=#totalBilled#>
	<cfhttpparam type="Formfield" name="x_description" value=#salesDescription#>
	<cfhttpparam type="Formfield" name="x_cust_id" value=#x_cust_id#>
	<cfhttpparam type="Formfield" name="x_invoice_num" value=#invoiceNumber#>
	<cfhttpparam type="Formfield" name="x_company" value=#x_company#>
	<cfhttpparam type="Formfield" name="x_first_name" value=#x_first_name#>
	<cfhttpparam type="Formfield" name="x_last_name" value=#x_last_name#>
	<cfhttpparam type="Formfield" name="x_address" value=#cardAddress#>
	<cfhttpparam type="Formfield" name="x_city" value=#cardCity#>
	<cfhttpparam type="Formfield" name="x_state" value=#cardState#>
	<cfhttpparam type="Formfield" name="x_zip" value=#cardZip#>
	<cfhttpparam type="Formfield" name="x_country" value=#cardCountry#>
	<cfhttpparam type="Formfield" name="x_email" value=#emailAddress#>
	<cfhttpparam type="Formfield" name="x_phone" value=#phone#>
	<cfhttpparam type="Formfield" name="x_line_item" value=#qbLineItem#>

<!--- Because coldfusion's ListToArray object ignores empty fields, we must
put a null in all empty fields to make sure that they are not skipped --->
<cfset post_response=(cfhttp.filecontent, "||", "|null|", "all")>
<!--- the same command is run twice, because the first time it only adjusts
every other empty field --->
<cfset post_response=(post_response, "||", "|null|", "all")>

<!--- now the ListToArray method can be used without skipping fields --->
<cfset response_array=ListToArray(post_response, "|")>

<cfparam name=response_array[1] default="">
<cfparam name=response_array[3] default="">

<cfset errorNetCardNumber="">
<cfset errorNetCardCCV="">
<cfset errorNetExpiration="">
<cfset errorNetCardAddress="">

<cfif response_array[1] is "1">
	<cfset errorpayment="0">
	<cfset paymentConfirmed="paymentConfirmed">
	<cfset errorPaymentMessage="">
	<cfset errorpayment="1">
	<cfset paymentConfirmed="declined">
	<cfset errorPaymentMessage="<h3><b>Your Credit Card has been 
declined. Please check your information and correct any 
	<!--create card error messages-->
	<cfif response_array[3] is "6" or response_array[3] is "37">
		<cfset errorNetCardNumber="<h3>Your credit card number is 
	<cfif response_array[3] is "7" or response_array[3] is "8">
		<cfset errorNetCardNumber="<h3>Please check your card number, 
expiration, CCV, and address.</h3>">
	<cfif response_array[3] is "11" >
		<cfset errorPaymentMessage="<h3>This submission of your Credit 
Card has been declined because it is a duplicate entry.<br>Please wait a few 
moments before resubmitting it.</h3>">
	<cfif  response_array[3] is "45" or response_array[3] is "65" >
		<cfset errorNetCardNumber="<h3>Please check your card number, 
expiration, CCV, and address, one at least does not match.</h3>">
		<cfset errorNetCardNumber="<h3>Please check your card number, 
expiration, CCV, and address, they don't match what is on file.</h3>">
	<cfif response_array[3] is "27">
		<cfset errorNetCardNumber="<h3>There is an error in your card 
		<br>Please check your card number, expiration, CCV, or 

<!--- / stuff --->

Open in new window

I am not sure what I am doing to cause a problem in the expressions structure. What am I missing?

Thanks as always. =)

Eric BourlandAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

From the comments, it looks like they meant to do some sort of replace but forgot to include the function name before the "(" in these two lines:

     <cfset post_response=(cfhttp.filecontent, "||", "|null|", "all")>
     <cfset post_response=(post_response, "||", "|null|", "all")>

Try adding the "replace" function:

     <cfset post_response= replace(cfhttp.filecontent, "||", "|null|", "all")>
     <cfset post_response= replace(post_response, "||", "|null|", "all")>

That said... the example seems like it was written for an old version of CF.  The comment about list functions and empty elements is no longer true.  Might want to rewrite some of it to take advantage of newer functionality.
I think you can just replace those three lines with:

     <cfset response_array=ListToArray(cfhttp.filecontent, "|", true)>

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Eric BourlandAuthor Commented:

Good morning. It's working; your solution makes sense. I am working with sample code from the web site; this deprecated code was written years ago.

My current task is to have people fill out a simple conference registration form, selecting an attendance option and an appropriate fee -- submit the form -- and then display the filled-out payment form, where the user can then fill in credit card info. (I do not want to deal with credit cards and PCI compliance; I will let handle this.) This has been an ongoing challenge -- but I am learning a lot.

This solution works great. =)

Eric BourlandAuthor Commented:
Thanks as always. _agx_. Hope you're great.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.