Page 1 of 1

Problem with WORD (Find/Replace)

PostPosted: Tue Nov 07, 2017 5:35 pm
by Romeo
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

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 08, 2017 12:54 pm
by Enrico Maria Giordano
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
_oWord:Set("Visible",.f.)


with this

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


and this

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


with this

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


EMG

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 08, 2017 3:54 pm
by Romeo
Great Enrico,

i go ahead, but i got error when use:

_oText:TypeText( _cvar )

Have i to change also this ?

tks

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 08, 2017 3:55 pm
by Enrico Maria Giordano
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

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 08, 2017 4:27 pm
by Romeo
There are also other istructions, i am finding where is the problem.

I let you know

tks

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 08, 2017 5:40 pm
by Romeo
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

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 08, 2017 5:46 pm
by Enrico Maria Giordano
I just tried and worked fine here (latest FWH and xHarbour). Tried with Harbour also: no problems.

EMG

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 08, 2017 6:09 pm
by Romeo
It is a bug of my FWH 16.02 !

Antonio, any patch for me ?

tks

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 08, 2017 6:48 pm
by Enrico Maria Giordano
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

Re: Problem with WORD (Find/Replace)

PostPosted: Thu Nov 09, 2017 6:34 pm
by Romeo
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

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 15, 2017 4:09 pm
by Romeo
Please, nobody can helps me ??

The example is very sample !!

tks

Re: Problem with WORD (Find/Replace)

PostPosted: Wed Nov 15, 2017 5:20 pm
by Enrico Maria Giordano
It is a Harbour bug. Use xHarbour instead.

EMG

Re: Problem with WORD (Find/Replace)

PostPosted: Thu Nov 16, 2017 9:51 am
by Silvio.Falconi
But if there is a bug on Harbour is good to found it soon or advise Harbour Team

Re: Problem with WORD (Find/Replace)

PostPosted: Mon Nov 20, 2017 5:49 pm
by Romeo
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

Re: Problem with WORD (Find/Replace)

PostPosted: Mon Nov 20, 2017 6:01 pm
by Silvio.Falconi
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 !!!