Normal Topic WordMerge question (Read 604 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
WordMerge question
Jul 25th, 2005 at 9:40pm
Print Post Print Post  
When I use the newer Wordmerge my merge is successful but I receive a writeln() box that says:

LE name '' not in current form.
(Ref. File: C:\Sesame\WordMrgFrm\CUST_LEList.txt)

I see were the WriteLn() comes from in the code, But I did not understand why it is not telling me the Le name that is not correct.

// Added by TJM 8 Jan 05 to report any LE names in
// vNames that are not represented on current form

For n = 1 to @CountStringArray(vNames)

     If @Instr(vLEs, @AccessStringArray(vNames, n)) = 0 Then
     {
     WriteLn("LE name '" + @AccessStringArray(vNames, n) + "' not in current form.")
     WriteLn("(Ref. File: " + vNamesPath + ")" + @NewLine())
     }


If I open my Cust_LEList and copy one element name at a time into a new Cust_LEList (to figure out what LE name is the prob) I found that my problem is gone. I am figuring I have some un-viewable character or space in my old Cust_LEList that did not transfer to my new Cust_LEList. Is there a line of code that can be added to wordmerge that will point out problems such as this rather then the unexplainable one I did receive?

Thanks
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Alec
Lanticans
*****
Offline



Posts: 200
Location: Ascot, England, UK
Joined: Nov 22nd, 2002
Re: WordMerge question
Reply #1 - Aug 4th, 2005 at 8:55pm
Print Post Print Post  
Robert -

Sorry you haven't had a response to this. Do you still have the original LE name list file? if so could you send it (and preferably the app) to me please?
Thanks,
Alec
  

Alec
Back to top
IP Logged
 
Alec
Lanticans
*****
Offline



Posts: 200
Location: Ascot, England, UK
Joined: Nov 22nd, 2002
Re: WordMerge question
Reply #2 - Aug 4th, 2005 at 10:57pm
Print Post Print Post  
OK Robert, thanks for sending the files to me.

The problem is a very simple one.  The 'bad' file has two 'extra' carriage returns at the end of the file. The good file has only one.

The solution is to not have extra carriage returns at the end of your list of LE's.  However inserting an extra line of code replaces one too many CR: ...

vNames = @Insert(vNamesPath)
vNames = @Replace(vNames, @NewLine() + @NewLine(), @NewLine())      // GET RID OF DOUBLE Carriage Returns
vNames = @Replace(vNames, @NewLine(), ";")

While you're about it, there's another change I would suggest. I've had WordMerge fail because of double quote characters (") in the data, eg 24". This completely blocks the procedure working and they must be removed. This does the trick: It is shown after the existing replacement of embedded carriage returns, so you know where to put the new code:


// This next line gets rid of embedded carriage returns in the data fields
//  This is necessary otherwise the merge will fail
     vData = @Replace(vData, @Newline(), "  ")

// This next line gets rid of double quotes in the data fields. Puts in 2 x single quotes.
//  This is necessary otherwise the merge will fail ('cannot open source document')
     vData = @Replace(vData, @Chr(34), @Chr(39) + @Chr(39)  )


This will probably be in the next Inside Sesame.
  

Alec
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: WordMerge question
Reply #3 - Aug 4th, 2005 at 11:30pm
Print Post Print Post  
Thanks Alec.

All help and Tips are always appreciated.

Robert
Smiley
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged