Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cecil Champenois
  Where is Cecil Champenois?
 Little Elm
 Texas - United States
 Cecil Champenois
 To: Tore Bleken
  Where is Tore Bleken?
 Stokke
 Norway
 Tore Bleken
 Tags
Subject: RE: Error Message: Line is too long
Thread ID: 393987 Message ID: 393990 # Views: 59 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Friday, December 27, 2013 8:53:54 PM         
   


> > Anyone run into this before?
> >
> > Here is the offending line of code:
> >
> > APPEND FROM (lcFilePathName) TYPE SDF
> > 

> > lcFilePathName translates to the following path:
> > K:\DATA\COMMON\FEED\IN
> >
> > I previously had a path that had a couple folders with spaces in their names, so I had put quotes around the path in the config file which held the paths. So, because I read that spaces in folder names cause problems I put the input file into a folder which had no spaces in its folder names. Same issue. Didn't change anything. Is this a FoxPro bug, or did I do something wrong?
> >
> > Cecil Champenois, Jr.
>
> I suggest that you check again, something else must be wrong. The error must come from some other line of code.
>
> There's a fine line between helping and adding to the confusion.
>
> How to create sample data

I found nothing wrong with any of the code, not as far as I could see it. Here's the rest of the code:
********************************************************************
lcPreviousDefault=SYS(5) + SYS(2003)	&& Get the current directory.
DIMENSION aCoveragesData[1,1]		&& Create the array aCoveragesData.
SET DEFAULT TO (inputPolicyDataPath)	&& SET DEFAULT TO "G:\Common\Shared Data\Trans America\IN"

* Check the folder for the COVERAGES file. Put what you find into the array, a Census.
=ADIR(aCoveragesData,"COVERAGES_*.TXT")
* If the COVERAGES_ file is NOT in the folder, send out a notification.
IF EMPTY(aCoveragesData)
	* Array has no data in it (no file name).
	lcMessageText="  No COVERAGES_*.TXT file was located. "
	logStr =  TTOC(DATETIME()) + " " + APPNAME + lcMessageText + CRLF
	=STRTOFILE(logStr, _LogFile, .T.)
	? "COVERAGES_ File was NOT found."
	TRY
		gcMailTo="cecil.champenois@amwins.com,wendy.champion@amwins.com"
		QUEUE_MAIL(APPNAME, "<developers>", gcMailTo, ;
			"No COVERAGES_ File located!", APPNAME+ ;
			": A COVERAGES_ FILE is required for this " + ;
			"program to function properly. Ending Program.", "", .F., .F.)
	CATCH
	ENDTRY
	
	RETURN .F.	&& Exits the procedure.
ELSE
	***************************************************************************
	* Use ASORT() function to put latest date in File Name to the top of
	* the Array Sort.
	* 1st Parameter: aCoveragesData (Array Name)
	* 2nd Parameter: nStartElement = 1
	* 3rd Parameter: nNumberSorted = -1  <- This gives us the number sorted.
	*                All rows.
	* 4th Parameter: nSortOrder = 0 for Ascending and 1 for Descending.
	***************************************************************************
	* Pick up the File Name with the latest Date in the File Name. Forces the
	* file with the latest date to the top of the array, since the date is part
	* of the file name.
	* Sort files in Descending Order. This floats the latest file to the top.
	=ASORT(aCoveragesData, 1, -1, 1)		&& Float latest file to top of order.
	lcCoveragesDataFileName=aCoveragesData[1,1]	&& Get File Name.
	lcCoveragesFileName=aCoveragesData[1,1]		&& Helps get File Date further down in code.
	lcCoveragesDataFileName=ADDBS(inputPolicyDataPath) + lcCoveragesDataFileName	&& Path & File Name.
ENDIF
SET DEFAULT TO (lcPreviousDefault)	&& Put the default back.
*** 09/24/2013 Cecil Champenois. End.

* Get the date from the File Name, on the right side of the file name.
lcCoveragesFileDate=LEFT(RIGHT(lcCoveragesFileName,12),8)	&& 20131031.
* Arrange as 10/31/2013.
lcCoveragesFileDate=;
	SUBSTR(lcCoveragesFileDate,5,2) + "/" + ;
	SUBSTR(lcCoveragesFileDate, 7,2) + "/" + ;
	LEFT(lcCoveragesFileDate,4)
ldCoveragesFileDate=CTOD(lcCoveragesFileDate)	&& Make it into a DATE data type.

CREATE CURSOR COVERAGES_INPUT ( ;
	TPASource C(2),  CertNo C(10),     FaceIncrea C(9),  PlanCode C(8),   CvgPhase C(3), ;
	Iss_Date C(8),   PolUnits C(9),    ValPerUnit C(9),  MatExpDt C(8),   IssAge C(3), ;
	PsnCovered C(1), AnPrmPerUn C(7),  AgentPhase C(3),  CvgTrgtPrm C(9), BenEligDt C(8))

* IMPORT the COVERAGES Text File.
SELECT COVERAGES_INPUT
lcFilePathName=lcCoveragesDataFileName
*WAIT WINDOW NOWAIT ;
	"Appending data from the Coverages input file: " + lcCoveragesDataFileName

APPEND FROM (lcFilePathName) TYPE SDF

SELECT DISTINCT CertNo AS CertNo, PsnCovered FROM Coverages_input INTO CURSOR tmpCoverages
SET STEP ON
SELECT ;
		td.CertNo, ;
		td.GroupNo, ;
		tc.PsnCovered, ;
		td.LOB, ;
		td.CntrctStat, ;
		td.OrigBenDt, ;
		td.Bill_Mode, ;
		td.Bill_Prem, ;
		td.Term_Date, ;
		td.OwnerName ;
	FROM ;
		tmpData td ;
	JOIN tmpCoverages tc ON td.CertNo=tc.CertNo ;
	ORDER BY GroupNo, LON ;
	INTO CURSOR tmpFinal


Here is what is in the VFP HELP:


The maximum length for a command line (8,192 bytes) has been exceeded.

Macro substitution might have caused the line to expand beyond the 8,192-byte limit.

---
Then there is this:

The object code produced for this statement exceeded the size of the Visual FoxPro internal code buffer.

This line contains too many long expressions.

Subdivide the line into multiple statements.



Cecil Champenois, Jr.

ENTIRE THREAD

Error Message: Line is too long Posted by Cecil Champenois @ 12/27/2013 8:02:35 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/27/2013 8:35:48 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/27/2013 8:53:54 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/27/2013 9:42:43 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/27/2013 9:51:23 PM
RE: Error Message: Line is too long Posted by David Mustakim @ 12/28/2013 12:29:31 AM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:20:39 AM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/28/2013 5:09:26 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:22:00 AM
RE: Error Message: Line is too long Posted by Pete Sass @ 12/28/2013 12:35:53 AM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:24:04 AM
RE: Error Message: Line is too long Posted by Pete Sass @ 12/30/2013 2:56:32 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:21:54 PM
RE: Error Message: Line is too long Posted by Pete Sass @ 12/30/2013 5:30:19 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 5:42:08 PM
RE: Error Message: Line is too long Posted by Stefan Wuebbe @ 12/27/2013 9:17:17 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 2:03:43 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/30/2013 2:14:05 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 2:17:13 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/30/2013 2:29:27 PM
RE: Error Message: Line is too long Posted by Stefan Wuebbe @ 12/30/2013 2:30:25 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/30/2013 3:00:24 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:11:24 PM
RE: Error Message: Line is too long Posted by Vivek Deodhar @ 12/30/2013 3:22:50 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:35:27 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/30/2013 3:39:06 PM
RE: Error Message: Line is too long Posted by David Mustakim @ 12/30/2013 3:40:34 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/30/2013 3:42:56 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:44:15 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/30/2013 3:47:20 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:49:18 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:42:54 PM
RE: Error Message: Line is too long Posted by Tore Bleken @ 12/30/2013 3:36:39 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 3:40:55 PM
RE: Error Message: Line is too long Posted by David Mustakim @ 12/30/2013 3:53:02 PM
RE: Error Message: Line is too long Posted by Tony Vignone @ 12/30/2013 5:53:15 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 6:01:43 PM
RE: Error Message: Line is too long Posted by Tony Vignone @ 12/30/2013 6:08:33 PM
RE: Error Message: Line is too long Posted by David Mustakim @ 12/30/2013 6:17:05 PM
RE: Error Message: Line is too long Posted by Cecil Champenois @ 12/30/2013 6:58:42 PM
RE: Error Message: Line is too long Posted by Tony Vignone @ 12/30/2013 6:52:22 PM