Problem with WORD (Find/Replace)

Problem with WORD (Find/Replace)

Postby Romeo » Tue Nov 07, 2017 5:35 pm

Hi all,

I am using the version FWH 16.02 but i got problem with WORD. My previous version of FWH (8.10) does not have this problem and works very well !!

This simple program does not work with versione FWH 16.02:

function main()
local _cfile:=HB_curdrive()+":\"+curdir()+"\test.doc"
local _oword,_oDoc,_oText,_oFind,_lex,_cfound

_oWord :=TOleAuto():New( "Word.Application" )
_oDoc :=_oWord:Get( "Documents" )
_oWord:Set("Visible",.f.) && HERE I START TO HAVE ERRORs
_oDoc:Open(_cFile )
_oText:=_oWord:Selection()
_oFind:=_oText:Find()
_oFind:Text:="#*#"
_oFind:Wrap:=1
_oFind:Set("MatchWildcards",.t.)
_oFind:Execute()
_lex:="#" $ _oText:Text
_cFound:=alltrim(SubStr(_oText:Text,2,Len(Alltrim(_oText:Text))-2))
if ! empty(_cfound)
msginfo("Found: "+_cFound)
else
msginfo("Not Found !")
endif
_oDoc:Close( 0 )
_oWord:quit()
return nil

****
THIS IS THE SIMPLE FILE .doc:

**start doc

Ciao io sono il sig.#ROSSI MARIO#

** end file doc


MANY, MANY THANKS FOR HELP, HELP !!

Romeo
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Postby Enrico Maria Giordano » Wed Nov 08, 2017 12:54 pm

As I advised you in private mail, it's one of the many Harbour bugs. You have to replace this

Code: Select all  Expand view  RUN
_oWord:Set("Visible",.f.)


with this

Code: Select all  Expand view  RUN
_oWord:Visible = .f.


and this

Code: Select all  Expand view  RUN
_oFind:Set("MatchWildcards",.t.)


with this

Code: Select all  Expand view  RUN
_oFind:MatchWildcards = .t.


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with WORD (Find/Replace)

Postby Romeo » Wed Nov 08, 2017 3:54 pm

Great Enrico,

i go ahead, but i got error when use:

_oText:TypeText( _cvar )

Have i to change also this ?

tks
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Postby Enrico Maria Giordano » Wed Nov 08, 2017 3:55 pm

Romeo wrote:Great Enrico,

i go ahead, but i got error when use:

_oText:TypeText( _cvar )

Have i to change also this ?

tks


This is not in your sample.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with WORD (Find/Replace)

Postby Romeo » Wed Nov 08, 2017 4:27 pm

There are also other istructions, i am finding where is the problem.

I let you know

tks
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Postby Romeo » Wed Nov 08, 2017 5:40 pm

In the above sample, if my doc is:

*******

Ciao io sono il sig.#ROSSI "di" MARIO#

*******

the istruction of my sample:

_cFound:=alltrim(SubStr(_oText:Text,2,Len(Alltrim(_oText:Text))-2))

gives me:

ROSSI ?di? MARIO instead of ROSSI "di" MARIO

It is a problem for me, and i don't understand the reason,

All works fine in my old version of FWH 8.10 (HARBOUR)

The problem happens only on the earler version FWH 16.01 (HARBOUR)

tks for any help
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Postby Enrico Maria Giordano » Wed Nov 08, 2017 5:46 pm

I just tried and worked fine here (latest FWH and xHarbour). Tried with Harbour also: no problems.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with WORD (Find/Replace)

Postby Romeo » Wed Nov 08, 2017 6:09 pm

It is a bug of my FWH 16.02 !

Antonio, any patch for me ?

tks
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Postby Enrico Maria Giordano » Wed Nov 08, 2017 6:48 pm

Romeo wrote:It is a bug of my FWH 16.02 !


Don't think so. It is more likely that you are using wide chars for double quotes instead of the ASCII ones.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with WORD (Find/Replace)

Postby Romeo » Thu Nov 09, 2017 6:34 pm

Ops !

EMG found the error, but cannot resolve it.

He suggest me to post it here

Please download this very sample program e try why i get the problem !!


http://www.modularsoftware.it/~connetti ... eplace.zip


BCC: 7.2
HARBOUR 3.2.0dev (r1603082110)
FWH: 16,02

many thanks to all
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Postby Romeo » Wed Nov 15, 2017 4:09 pm

Please, nobody can helps me ??

The example is very sample !!

tks
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Postby Enrico Maria Giordano » Wed Nov 15, 2017 5:20 pm

It is a Harbour bug. Use xHarbour instead.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with WORD (Find/Replace)

Postby Silvio.Falconi » Thu Nov 16, 2017 9:51 am

But if there is a bug on Harbour is good to found it soon or advise Harbour Team
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7086
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with WORD (Find/Replace)

Postby Romeo » Mon Nov 20, 2017 5:49 pm

As also Linares confirmed me, there is a bug in Harbour...

I have wrotye to harbour group
(https://groups.google.com/forum/#!newto ... bour-users)

And also they said me: there is a bug in Harbour (!), but non in xHarbour

I'am waiting sameone resolve it..

I'm praying to all the saints and I hope someone fixs the bug, otherwise I'm in very bad trouble with my clients ;-(

R
Romeo
 
Posts: 340
Joined: Thu Jan 25, 2007 3:53 pm
Location: Milan (Italy)

Re: Problem with WORD (Find/Replace)

Postby Silvio.Falconi » Mon Nov 20, 2017 6:01 pm

I hope you solve your problems soon

But I'm convinced, given my experience in this forum and google forums and others

that if the topic is of personal interest nobody will try to solve the problem,

but if the subject is of general interest then you will see that some important guru will be beautiful in the chicken coop !!!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7086
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests