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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to EDIT a file within a Focus session?

Status
Not open for further replies.

PeterG5

Programmer
Apr 29, 2003
68
IE
Hi All,

I'm writing a focexec where, towards, the end, I need to intervene and change the contents of a hold file (.ftm format) before doing a MODIFY based on the altered contents. My problem is that I'm unable to edit the hold file using DOS EDIT or Wordpad. I can, of course, stop the fex, edit the file in DOS and run another fex to complete the operation but I was hoping to do it all in the one run. I've tried calling a BAT file with the edit/wordpad command imbedded but nothing happens - Focus just seems to ingore it. Any suggestions?

Thanks, Peter.
 
It may help to know what kind of change is required. Have you tried querying the hold and incorporating the change in a subsequent hold and using this one instead as your source? Can you give a bit more info?
 
HI jdkIT,

I want to use Wordpad (preferably) to change the contents
of the hold file. This file is a report of errors in our product descriptions and I want to correct these before running the MODIFY section which will update the original file with the corrected values.
The original FILEDEF issued by Focus is still in place, so
it will just see the new values and apply them in the MODIFY.

Thanks, Peter.
 
It used to be that you had to precede a DOS command with DOS as in 'DOS DIR *.*'. This was especially true for things that Focus would not recognize as DOS commands like the name of a batch file. After the DOS command, a subsequent -RUN would be needed to execute the command.

Does your MODIFY support CRTFORM? If so, why not update the values within the MODIFY prior to the update? If not, why not use MAINTAIN to support the interactive process.

 
Peter,

Do you get any error messages, when you invoke DOS EDIT?

You're on DOS, but what product are you using (FFW, WebFocus, etc.).

One thing to keep in mind, in most later releases, we HOLD in binary format, for efficiency. You may neeed to HOLD FORMAT ALPHA.
 
Hi Focwizard,

I'm holding format alpha,leaving the fex
and editing the hold file using wordpad.
I then invoke a second fex to do the MODIFY,
using the altered contents of the hold file.
I just wanted to do it all in one fex.
I think it's possible to invoke the DOS EDIT command by calling a BAT file with the edit command imbedded therein but you only get the very basic editor and I really want to use wordpad in full-screen mode.
I'm using Webfocus 431 and in my previous life in the
VM environment, I would simply have issued a CMS XEDIT command within the focexec and it would have let me edit the file. Having then saved the file, control would return
to Focus and the MODIFY could proceed.

Peter.
 
You can invoke Wordpad, but you must specify the FULL path to 'wordpad.exe' (it has to do with how programs are found by the operating system). Use Windows Explorer, to find where 'wordpad.exe' exists, and invoke it using the fully qualified path name, enclosing the entire path, through 'wordpad.exe', in double quotes. For example, on my Win2K box, I typed:

dos "c:\program files\windows nt\accessories\wordpad.exe"

and it came up.
 
Thanks Focwizard,

That suggestion seems to do the trick.

Peter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top