FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with WORD (Find/Replace)
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Problem with WORD (Find/Replace)
Posted: Tue Nov 07, 2017 05: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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with WORD (Find/Replace)
Posted: 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 (fw): Select all Collapse
_oWord:Set("Visible",.f.)


with this

Code (fw): Select all Collapse
_oWord:Visible = .f.


and this

Code (fw): Select all Collapse
_oFind:Set("MatchWildcards",.t.)


with this

Code (fw): Select all Collapse
_oFind:MatchWildcards = .t.


EMG
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 08, 2017 03:54 PM

Great Enrico,

i go ahead, but i got error when use:

_oText:TypeText( _cvar )

Have i to change also this ?

tks

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 08, 2017 03: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
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 08, 2017 04:27 PM

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

I let you know

tks

Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 08, 2017 05: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

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 08, 2017 05:46 PM

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

EMG

Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 08, 2017 06:09 PM

It is a bug of my FWH 16.02 !

Antonio, any patch for me ?

tks

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 08, 2017 06: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
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Problem with WORD (Find/Replace)
Posted: Thu Nov 09, 2017 06: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

Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 15, 2017 04:09 PM

Please, nobody can helps me ??

The example is very sample !!

tks

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Problem with WORD (Find/Replace)
Posted: Wed Nov 15, 2017 05:20 PM

It is a Harbour bug. Use xHarbour instead.

EMG

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with WORD (Find/Replace)
Posted: Thu Nov 16, 2017 09: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 March-April 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
Posts: 340
Joined: Thu Jan 25, 2007 03:53 PM
Re: Problem with WORD (Find/Replace)
Posted: Mon Nov 20, 2017 05: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

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with WORD (Find/Replace)
Posted: Mon Nov 20, 2017 06: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 March-April 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

Continue the discussion