Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

length of string to left of nth word

Status
Not open for further replies.

AlastairP

Technical User
Feb 8, 2011
286
AU
I need to find the length of the characters in a string left of a found word using GETWORDNUM

Code:
lnWcnt=GETWORDCOUNT(lcLine)
lnChr=0
lcFoundNext=.f.
FOR i = 1 TO lnWcnt
	lcCheckWord = GETWORDNUM(lcLine,i)
	SELECT cWrongWords 
	GO TOP 
	SCAN 
	   IF ALLTRIM(cWord) = lcCheckWord 
	     lcFoundNext=.t.
	     EXIT
	   ENDIF 
	ENDSCAN 
	IF lcFoundNext=.t.
	   EXIT
	ENDIF
ENDFOR

When I get to this point, I need a character count (including spaces) left of the specific word number. I can't use AT or similar because I don't know how many occurances there are left of the specific word located with GETWORDNUM. The answer is probably staring me in the face, I just can't see the wood for the trees right now!
 
I will look again at fox spell and see if I can use the msword dictionary.

Just to be clear: I didn't say you can use the Word dictionaries in FoxSpell. I said that you can import the custom dictionaries. In Word, you can open a custom dictionary as a text file. FoxSpell lets you append a text file into its own dictionary. You can therefore copy the custom words from Word to FoxSpell, for example to add technical terms. But this is not the same as using, for example, a British English dictionary in place of a US English one.

A client of mine wrote an article about using FoxSpell which you might find useful: Putting Foxspell Checker to work. (But note the article was written about 15 years ago.)

In my opinion, the main issue betweeen using Word or FoxSpell is that, with FoxSpell, the entire process is under your own control. You are not relying on another vendor's application which might or might not be installed on the user's system. On the other hand, if users are already using Word for spell checking, you can give them the familiar interface and all the advanced features that Word provides - including the ability to use their existing custom dictionaries without an import step.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
In regard of profession and suggesting to hire someone:

That's quite a political issue rather than a personal one. A few years ago there was a strong debate in germany about how do it yourself killed crafts professions/trades. Nobody forces you to hire painters to paint your ceiling or walls or to hang wallpaper. You can save money doing such things on yourself. We have professions for a reason and money is the exchange for üroducts and services. If someone does a sidejob not his profession he may or may not harm, but for example by law you are not allowed to wire devices like stoves to higher voltage three-phase AC because of the riscs of it not only during the wiring for your self, but the fire rsc for the whole house. Overall you soak income of other professions and harm economy and society. Management will surely argue, employees get their loan anyway, and if they can accomplish side tasks, why not? I think this is a bit short sighted.

On the one side I'm kind of in a do-it-yourself mindset myself, I'm rather self-taught in many things, as I like to define my own learning tempo. I now more and more tend to let professionals do what's not my profession. I see you glided into developing that application, but you continually lack the kind of logical low level thinking a developer should have and need help here. I sometimes think of the income I could have had with all the help given, but that's of course only half the truth, as all my community work spreads over a very large range of vfp developers partly professional, partly not. My current professional situation is so bad on a personal rather than the professional level, I think of quitting. This is setting my current mood and attitude, forgive that.

Developer contracting mainly consist of teaching developers as much insight on field experience to do the code implementation than to teach field experts programming. It doesn't work this way in short terms, only in long terms. And it reason for many "youth sin" applications. Anyway, I wouldn't also welcome a strict policy not allowing anyone to do stuff aside of their main profession, that would bring down the variety and fun of jobs. The fun thing about being developer is, that you get in touch with many topics. That doesn't apply to my past, as I mainly worked for one business, but applies in general.

I hope this gives you some insight of why I am the way I am. I see this mainly as management fail rather than as fail of the people engaging in their job and doing more than they were hired for, but you're exploited in some way or the other and you only let that happen, because of the diversification of your work. It's a double edged sword.

On the highest level: How many exploits of applications could be prevented, if only professionals would develop? Professions like designers (especially web designers) have this problem on a larger scales, as there are good hobbyist artists and designers. The state also didn't develop good training programs for todays professions. The landscape of professions grew faster than government could catch up with and so my profession of developers today has a high percentage of freelancers without a state education of what they advertise and offer to do, self acclaimed developers. It's quite a pest of how they jump from project to project, company to company, not learning loyalty and long term responsibility. Not seeing the long term damage they do with errors showing up after a database has grown a few years, etc. At least in that respet it sounds you and also John Fox are long year employees and you surely have an insight of that and what it means to continually develop and extend some larger project.

Can you at least understand my point of view, even if you won't agree?

Bye, Olaf.
 
I understand and to a degree agree with you in most respects. However, I am also of the view that personal improvement and diversity of skill can only be attained by trying new things, learning for yourself.
Classifying yourself by your profession is really not a true indication of who you are, or what you are capable of, or what your passion is.
I could call myself a bunch of different titles like Service Manager,Esitmator, Programmer and Commissioner, Trademan, even IT professional. Do I have the qualifications, degrees and trade certificates? Yes I do. Does that make me good at what I do? Perhaps. I do know that I could not live any other way. There are always going to be people like me who will delve into new areas. This is human nature.
So am I being exploited by my company because I am willing to engage in programnming and developing? Perhaps. Should we have enaged a outside contractor? I don't believe so. Not in this case.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top