Re: RUN the VI editor from a 4GL program
Posted in 1997
Jacob Salomon wrote: > Hi Folks, > I developing an application that involved allowing users to create/edit > a text blob using the vi editor. (I suspect the exact editor is not the > problem here, however.) I piece together the file name at run time and > "locate" the blob variable there with the following snippet of code: Jake, It appears you're working too hard. I haven't done 4GL in quite a while but I never had to go through all the stuff you're going through. I recall locating a TEXT blob in the 4GL program, and then in my PER file setting the field where the TEXT field lives to PROGRAM = vi, or something like that, in the ATTRIBUTES section. Then when the user is on the field in the form, they press the '!' key, and the vi editor will pull up the text stored in the data base. You have to have the located blob already in your program buffers, via a SELECT. This is so simple, and easy to support, as it's standard with the 4GL. If you want a fast example, download bas_4gl from my web site, and generate a simple one-table program where you have a table with a TEXT BLOB. ( If you download bas_4gl be sure to get the whole SHAR file, with a couple of other tools in it, so that bas_4gl will work) However if you're not using a TEXT BLOB, your scenario could still be quite simple, by creating a run statement: LET run_cmd = "vi ",file_name CLIPPED RUN run_cmd as you've already shown. As far as your terminal not working, this looks like a TERMCAP or TERM problem. It may be the raw/cooked scenario, but check your environment first, before screwing around with raw/cooked. You could be working too hard once again. Hope this is of some help! :-) Tim tschaefe@mindspring.com www.mindspring.com/~tschaefe