Subject Re: Editor Problem
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 12 Jul 2024 09:17:34 +0200
Newsgroups dbase.getting-started

On 2024/07/09 20:20, Norman Snowden wrote:

> Mervyn, Thanks for your new valuable code. My following comments are for information only. You have already done enough >. I don't expect any more response.
> When I ran your code I got the Error message: " Expecting Character for the Lines rm.editor1.value += '        ' + D + '    '+LTRIM(E)
>       form.editor1.value += '            '+ LTRIM(F)+ '      ' + G

The error indicates that ether the value saved to E or F ( the value in
the field state or phone) is not of type character.  Remove the LTRIM()
for E and F and see if the code runs.  Removing the LTRIM() will upset
the spacing of the text in the editor but this can be fixed once the
code runs.

If you copy a few records from your table into a sample table and post
it here I can test the code to make sure it runs properly.

> Rather than trying to find the answer to this minor error, I opened this successful program on my Laptop. For some dumb reason, I clicked Print when there is no Printer connected. This caused the Program to only Flash and close when Clicking on Print. Back on the Laptop  when I Clicked Print I got the message: Error: In use by another :Plot-Relatives.txt, Line 1703, fFile.create('plot_Relatives.txt'). Additionally, when I open the program, the Entries for Lname, appear as: C:\mykinda|plot Rle. The  function PUSHBUTTON10_onClick()
>      ***************
>               Chooseprinter()
>                         Set Printer On                      
>                 cFile = set('directory')+'\plot_relatives.txt' // From Murvyn 04/23/22
>          oWord = new oleAutoclient("word.application")
> //      oWord.ChangeFileOpenDirectory( set('directory')+'\')
>         oWord.documents.open(cFile,false,true)
>         oWord.activeDocument.printOut()
>         oWord.quit( 0 )
>         release object oWord
>         oWord = null
>       return,,  provides the basis for Printing. This is beyond my dBase knowledge. The Microsoft Word communication must come from the Word in my computer. Again, when I run the Program The message comes up: In use by another. For now I will just use a List or Display Command that shows all the People rather than a separate Relative list. Mervyn, Thanks for your patience and help for many years, Norman

The "in use by another" message is usually shown because dBASE hasn't
closed a table it was using.  This can happen if you try to print
plot_Reletives.txt before dBASE has finished writing to it.

Usually typing CLOSE ALL in the Command Panel sorts it out but closing
and the restarting dBASE should definitely do the trick although forcing
dBASE to close the file may mean that not all the data has been written
to it.

What version of dBASE are you using?  Building a report line by line and
saving it to a text file so that it can be printed later was a technique
used back in the days of dBASE for DOS.  If you are using a more modern
version of dBASE the Report Designer can do a far better job.  If you
post a sample table I'll give you a working example.

Mervyn.