Re: RUN the VI editor from a 4GL program
Posted in 1997
I, Jake Salomon posted a request for help, repeated below this posting. My problem, in short, is that when I run vi from the 4GL program, I see the escape sequences as strings instead of having vi run normally. Well..... it turns out that when I run it from the fglgo, vi does run normally. The grief happened only when I ran it during a debugging session. I think I have a bug in the debugger. For testing purposes, I was able to work around the bug. Why am I so quick to label this a product bug when I just spent a weekend pondering over my own program bug? Because the same command works properly in a running program (under fglgo) and produces bananas results under the debugger. The version is 6.01.UD2. Some folks proposed to me.. Wait, not that way!.. Anyway, some suggested I try: RUN cmd_line IN LINE MODE or RUN cmd_line IN FORM MODE and niether appears in my 4GL reference manual. Both these forms resulted in syntax errors fromt the compiler. I have, however, found on page 3-44 of Suppliment, a new OPTIONS option: RUN <mode> where <mode> is either LINE MODE or FORM MODE. Since the default RUN mode is line anyway, I don't think this option will help me during the bugging session. Tim suggested I simply let the user use the ! option of the INPUT form. This is impractical for me, since the screen is already moderately busy, leaving no room for part for the text blob to be displayed on the form. Thanks for the help, folks. -- -- Jake (Lost in thought and won't ask for directions) . . _..-'( )`-.._ ./'. '||\\\\. }\\_/{ .//||` .`\\. ./'.|'.'||||\\\\|.. )o o( ..|//||||`.`|.`\\. ./'..|'.|| |||||\\`````` \\,@,/ ''''''/||||| ||.`|..`\\. ./'.||'.|||| ||||||||||||. ||| .|||||||||||| ||||.`||.`\\. /'|||'.|||||| ||||||||||||{ | }|||||||||||| ||||||.`|||`\\ '.|||'.||||||| ||||||||||||{ | }|||||||||||| |||||||.`|||.` '.||| ||||||||| |/' ``\\||`` | ''||/'' `\\| ||||||||| |||.` |/' \\./' `\\./ \\!|\\ /|!/ \\./' `\\./ `\\| V V V }' `\\ /' `{ V V V \\ \\ \\ V / / / +-----------------------------------------------------------+ | Impeccable Logic: A thought process which successfully | | resists chicken bites | +-----------------------------------------------------------+ > > 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: > > let curtime = current hour to second > let fname # Piece together a file name > = "/tmp/blob.", login_name clipped, "-", curtime clipped > > locate rp_libdoc_ldesc # Set up to edit/display in this file > in file fname > > I then piece together the vi command line: > > let edit_cmd = "vi ", fname > > So the command line looks something like: > libdoc.4gl:edit_lib_long.edit_cmd = "vi /tmp/blob.jake-17:14:57" > > Next, I RUN the command: (I am copy/pasting to a debugging session) > run edit_cmd > > This definitely gets me into vi. However, instead of looking like vi, > I see the escape sequences as strings on my screen. If I enter :f > command, I see the result buried in the garbage but I can't get it to > behave like vi! > > Is it my emulator? Is this related to the debugger (or any 4GL > application) running in raw terminal mode already? If the latter, what > can I do to correct for this and get a normal vi session running? I > believe this will happen even if I use emacs; it's the terminal that's > screwed up! > >[3g[44;9HH[44;17HH[44;25HH[44;33HH[44;41HH[44;49HH[44;57HH[44;65HH[44;73HH[44;81HH[44;1H[?25h[?1h="/tmp/blob.jake-17:14:57" > > The above is what I see when vi is running. Yucch! > > Any ideas? Thanks.