• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Branch target offset too large for short

Explorer ,
Jun 16, 2006 Jun 16, 2006

Copy link to clipboard

Copied

Error :
I am getting the error "Branch target offset too large for short" in coldfusion.

What we are trying to do?
We are concatenating large numbers of text. We where building a lengthly string. We ended up using mutliple variables and
appending them together at the end to get it to work.

Appending the lengthy string and writing into a file.

Just to breif you this is a survey questions and answers we are generating text file with tab seperated as delimeters.

e.g.
The string I am using is
<cfset Questions = Number#TabChar#Q1#TabChar#Q2A#TabChar#Q2B#TabChar#Q2C#TabChar#Q3A#TabChar#Q3B#TabChar#Q3C#TabChar#Q3D#TabChar#Q3E#TabChar#Q3F#TabChar#Q3G#TabChar#Q4A1#TabChar#Q4A2#TabChar#Q4A3#TabChar#Q4A4#TabChar#Q4A5#TabChar#Q4A6#TabChar#Q4B1#TabChar#Q4B2#TabChar#Q4B#TabChar#Q4B4#TabChar#Q4B5#TabChar#Q4B6#TabChar#Q4C1#TabChar#Q4C2#TabChar#Q4C3#TabChar#Q4C4#TabChar#Q4C5#TabChar#Q4C6#TabChar#Q4D1#TabChar#Q4D2#TabChar#Q4D3#TabChar#Q4D4#TabChar#Q4D5#TabChar#Q4D6#TabChar#Q4E1#TabChar#Q4E2#TabChar#Q4E3#TabChar#Q4E4#TabChar#Q4E5#TabChar#Q4E6#TabChar#Q4F1#TabChar#Q4F2#TabChar#Q4F3#TabChar#Q4F4#TabChar#Q4F5#TabChar#Q4F6#TabChar#Q4G1#TabChar#Q4G2#TabChar#Q4G3#TabChar#Q4G4#TabChar#Q4G5#TabChar#Q4G6#TabChar#Q4H1#TabChar#Q4H2#TabChar#Q4H3#TabChar#Q4H4#TabChar#Q4H5#TabChar#Q4H6#TabChar#Q4I#TabChar#Q4J#TabChar#Q4K#TabChar#Q5A1#TabChar#Q5A2#TabChar#Q5A3#TabChar#Q5A4#TabChar#Q5A5#TabChar#Q5A6#TabChar#Q5B1#TabChar#Q5B2#TabChar#Q5B3#TabChar#Q5B4#TabChar#Q5B5#TabChar#Q5B6#TabChar#Q5C1#TabChar#Q5C2#TabChar#Q5C3#TabChar#Q5C4#TabChar#Q5C5#TabChar#Q5C6#TabChar#Q5D1#TabChar#Q5D2#TabChar#Q5D3#TabChar#Q5D4#TabChar#Q5D5#TabChar#Q5D6#TabChar#Q5E#TabChar#Q5F#TabChar#Q5G#TabChar#Q6A#TabChar#Q6B#TabChar#Q6C#TabChar#Q6E#TabChar#Q6F#TabChar#Q6G#TabChar#Q6H#TabChar#Q6I#TabChar#Q6J#TabChar#Q6K#TabChar#Q7A1#TabChar#Q7A2#TabChar#Q7B1#TabChar#Q7B2#TabChar#Q7C#TabChar#Q7D#TabChar#Q8A#TabChar#Q8B#TabChar#Q8C#TabChar#Q8D#TabChar#Q8E#TabChar#Q8F#TabChar#Q8G#TabChar#Q8H#TabChar#Q9A1#TabChar#Q9A2#TabChar#Q9B1#TabChar#Q9B2#TabChar#Q9C1#TabChar#Q9C2#TabChar#Q9D1#TabChar#Q9D2#TabChar#Q9E1#TabChar#Q9E2#TabChar#Q9H1#TabChar#Q9H2#TabChar#Q9I1#TabChar#Q9I2#TabChar#Q9J1#TabChar#Q9J2#TabChar#Q9K1#TabChar#Q9K2#TabChar#Q9L1#TabChar#Q9L2#TabChar#Q9M#TabChar#Q9N#TabChar#Q9O#TabChar#Q9P#TabChar#Q9Q#TabChar#Q9R#TabChar#Q9S#TabChar#Q10A#TabChar#Q10B#TabChar#Q10C#TabChar#Q10E#TabChar#Q10F#TabChar#Q10G#TabChar#Q10H#TabChar#Q10I#TabChar#Q10J#TabChar#Q10K#TabChar#Q11A#TabChar#Q11B#TabChar#Q11C#TabChar#Q11D#TabChar#Q11E#TabChar#Q11F#TabChar#Q11G#TabChar#Q11H#TabChar#Q11I#TabChar#Q11J#TabChar#Q11K#TabChar#Q11L#TabChar#Q11M#TabChar#Q11O#TabChar#Q11P#TabChar#Q11Q#TabChar#Q11R#TabChar#Q12A1#TabChar#Q12A2#TabChar#Q12B1#TabChar#Q12B2#TabChar#Q12C1#TabChar#Q12C2#TabChar#Q12D1#TabChar#Q12D2#TabChar#Q12E#TabChar#Q12F#TabChar#Q12G#TabChar#Q12H#TabChar#Q12I#TabChar#Q12J#TabChar#Q12K#TabChar#Q12L#TabChar#Q13A1#TabChar#Q13A2#TabChar#Q13B1#TabChar#Q13B2#TabChar#Q13C1#TabChar#Q13C2#TabChar#Q13D1#TabChar#Q13D2#TabChar#Q13E1#TabChar#Q13E2#TabChar#Q13H1#TabChar#Q13H2#TabChar#Q13I1#TabChar#Q13I2#TabChar#Q13J1#TabChar#Q13J2#TabChar#Q13K1#TabChar#Q13K2#TabChar#Q13L#TabChar#Q13M#TabChar#Q13N#TabChar#Q14A1#TabChar#Q14A2#TabChar#Q14B1#TabChar#Q14B2#TabChar#Q14C1#TabChar#Q14C2#TabChar#Q14D#TabChar#Q14E#TabChar#Q14F#TabChar#Q14G#TabChar#Q14H#TabChar#Q15A#TabChar#Q15B#TabChar#Q15C#TabChar#Q15D#TabChar#Q15E#TabChar#Q15F#TabChar#Q15G#TabChar#Q15H#TabChar#Q16A#TabChar#Q16B#TabChar#Q16C#TabChar#Q16D#TabChar#Q16E#TabChar#Q16F#TabChar#Q17A1#TabChar#Q17A2#TabChar#Q17A3#TabChar#Q17B#TabChar#Q17C#TabChar#Q17D#TabChar#Q17E#TabChar#Q17F#TabChar#Q17G#TabChar#Q17H#TabChar#Q18A1#TabChar#Q18A2#TabChar#Q18B1#TabChar#Q18B2#TabChar#Q18C1#TabChar#Q18C2#TabChar#Q18D1#TabChar#Q18D2#TabChar#Q18E1#TabChar#Q18E2#TabChar#Q18H1#TabChar#Q18H2#TabChar#Q18I1#TabChar#Q18I2#TabChar#Q18J1#TabChar#Q18J2#TabChar#Q18K1#TabChar#Q18K2#TabChar#Q18L1#TabChar#Q18L2#TabChar#Q18M1#TabChar#Q18M2#TabChar#Q18N1#TabChar#Q18N2#TabChar#Q18O1#TabChar#Q18O2#TabChar#Q18P1#TabChar#Q18P2#TabChar#Q18Q1#TabChar#Q18Q2#TabChar#Q18R1#TabChar#Q18R2#TabChar#Q18S1#TabChar#Q18S2#TabChar#Q18T1#TabChar#Q18T2#TabChar#Q18U1#TabChar#Q18U2#TabChar#Q18V1#TabChar#Q18V2#TabChar#Q18W1#TabChar#Q18W2#TabChar#Q18X1#TabChar#Q18X2#TabChar#Q18Y1#TabChar#Q18Y2#TabChar#Q18Z1#TabChar#Q18Z2#TabChar#Q18A11#TabChar#Q18A12#TabChar#Q18B11#TabChar#Q18B12#TabChar#Q18C11#TabChar#Q18C12#TabChar#Q18D11#TabChar#Q18D12#TabChar#Q18E11#TabChar#Q18E12#TabChar#Q18H11#TabChar#Q18H12#TabChar#Q18I11#TabChar#Q18I12#TabChar#Q18J11#TabChar#Q18J12#TabChar#Q18K11#TabChar#Q18K12#TabChar#Q18L11#TabChar#Q18L1Z#TabChar#Q18M11#TabChar#Q18M12#TabChar#Q18N11#TabChar#Q18N12#TabChar#Q18O11#TabChar#Q18O12#TabChar#Q18P11#TabChar#Q18P12#TabChar#Q18Q11#TabChar#Q18Q12#TabChar#Q18R11#TabChar#Q18R12#TabChar#Q18S11#TabChar#Q18S12#TabChar#Q18T11#TabChar#Q18T12#TabChar#Q18U11#TabChar#Q18U12#TabChar#Q18V11#TabChar#Q18V12#TabChar#Q18W11#TabChar#Q18W12#TabChar#Q18X11#TabChar#Q18X12#TabChar#Q18Y11#TabChar#Q18Y12#TabChar#Q18Z11#TabChar#Q18Z12#TabChar#Q18A21#TabChar#Q19A#TabChar#Q19B#TabChar#Q19C>
<cfset answers=#Q1#q2#....>

Can anyone please help me out?

Views

729

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jun 16, 2006 Jun 16, 2006
Hi James,

Good Morning. Thanks for your response.

I didn't check the forum this morning. Actually what I did I am forming the string which will generate comma seperated value. I am keeping on concatenating it. It is due to memory problem (buffer). I found that I am getting this error. Later I went and resetting the variable.

For. Eg.
My string is
<cfset TabChar = Chr(9)>
<cfoutput>
<!--- set content type to invoke text --->
<cfcontent type="html/text">
<!--- open file and Write --->
<cffile ...

Votes

Translate

Translate
Contributor ,
Jun 16, 2006 Jun 16, 2006

Copy link to clipboard

Copied

Is this happening in a function?

I've had this error in one of my functions. and researched it before.
The answers I found had to do with having too big of a function. I broke my
function into two and it fixed the problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 16, 2006 Jun 16, 2006

Copy link to clipboard

Copied

LATEST
Hi James,

Good Morning. Thanks for your response.

I didn't check the forum this morning. Actually what I did I am forming the string which will generate comma seperated value. I am keeping on concatenating it. It is due to memory problem (buffer). I found that I am getting this error. Later I went and resetting the variable.

For. Eg.
My string is
<cfset TabChar = Chr(9)>
<cfoutput>
<!--- set content type to invoke text --->
<cfcontent type="html/text">
<!--- open file and Write --->
<cffile action="write" file="#GetTempDirectory()#sample.txt" output="Q1#Tabchar#Q2#TabChar#">
<!--- Taking savecontent as variable and storing the values --->
<cfloop query="query">
<cfset savecontent= savecontent & "#TabChar##query.column1#">
<cfif query.column1 NEQ "">
<cfset savecontent = savecontent & #TabChar# & #query.column1#>
<cfelse>
<cfset savecontent = savecontent & #TabChar#>
</cfif>
<cfif query.column2 NEQ "">
<cfset savecontent = savecontent & #TabChar# & #query.column2#>
<cfelse>
<cfset savecontent = savecontent & #TabChar#>
</cfif>
<!--- … and so on. At the end of it I am writing into the text file --->
</cfloop>
</cfoutput>
<CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=sample.txt">
<CFCONTENT TYPE="application/unknown" DELETEFILE="Yes" FILE="#GetTempDirectory()#sample.txt" RESET="Yes">

Later I changed the code as
<cfset TabChar = Chr(9)>
<cfoutput>
<!--- set content type to invoke text --->
<cfcontent type="html/text">
<!--- open file and Write --->
<cffile action="write" file="#GetTempDirectory()#sample.txt" output="Q1#Tabchar#Q2#TabChar#">
<cfloop query="query">
<!--- Taking savecontent as variable and storing the values --->
<cfset savecontent="#id##TabChar#">
<cfset savecontent= savecontent & "#TabChar##query.column1#">
<cffile action="append" file="#GetTempDirectory()#sample.txt" output="#savecontent#">
<!--- in my previous code I keep appending the variable savecontent. Now I am not (storing new value of savecontent)--->
<cfif query.column1 NEQ "">
<cfset savecontent = #TabChar# & #query.column1#>
<cfelse>
<cfset savecontent = savecontent & #TabChar#>
</cfif>
<cffile action="append" file="#GetTempDirectory()#sample.txt" output="#savecontent#">
<cfif query.column2 NEQ "">
<cfset savecontent = #TabChar# & #query.column2#>
<cfelse>
<cfset savecontent = savecontent & #TabChar#>
</cfif>
</cfloop>
</cfoutput>
<CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=sample.txt">
<CFCONTENT TYPE="application/unknown" DELETEFILE="Yes" FILE="#GetTempDirectory()#sample.txt" RESET="Yes">

Have a nice day

Thanks
Satheesh <cffile action="append" file="#GetTempDirectory()#sample.txt" output="#savecontent#"> <cfset savecontent = #TabChar# & #query.column1#>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation