我想在VI终端中打开一个.4gl文件并写入,这是我目前拥有的代码:
let p_command = "test -f ", MTGENDIR CLIPPED,"/",p_prog clipped,".4gl"
run p_command returning p_status
let p_command = "vi ",p_prog clipped,".4gl"
--let p_command = "w ",p_prog clipped,".4gl"
--let p_command = ":w ",p_prog clipped,".4gl"
run p_command这是我在调试器中遇到的错误,一旦调试器到达步骤vi,它就会挂起:
(fgldb) next
376 let p_command = "vi ",p_prog clipped,".4gl"
(fgldb) next
377 run p_command
(fgldb) next
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal如果我尝试使用上面注释的代码(w或:w)编写代码,它会崩溃并显示以下错误:
The DVM process crashed. Please contact FourJs support.
DVM has encountered a problem. Execution of 'mt_gen' stopped有没有其他方法可以在Genero中写入.4gl文件?
发布于 2021-01-08 06:48:52
回答最后一句话“有没有其他方法可以在Genero中写入.4gl文件?”然后,您可以使用base.Channel类来写入文件...
MAIN
DEFINE ch base.Channel
LET ch = base.Channel.create()
CALL ch.openFile("example.4gl","w")
CALL ch.writeLine("MAIN")
CALL ch.writeLine(" DISPLAY 'Hello World'")
CALL ch.writeLine("END MAIN")
CALL ch.close()
END MAIN..。关键比特是使用base.Channel.openFile和w(或a)作为开放模式http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ClassChannel_openFile.html
或者,您可以在STRING或base.StringBuffer变量中构建文件,并使用文本writeFile方法http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_datatypes_TEXT_writeFile.html ...
MAIN
DEFINE s STRING
DEFINE t TEXT
LET s =
"MAIN", ASCII(13),
" DISPLAY 'Hello World'", ASCII(13),
"END MAIN"
LOCATE t IN MEMORY
LET t = s
CALL t.writeFile("example2.4gl")
END MAIN我不明白为什么您认为需要在解决方案中使用vi/vim来写入.4gl文件。
https://stackoverflow.com/questions/65608746
复制相似问题