|
xy2fengye
初级用户
 
积分 55
发帖 23
注册 2005-8-11
状态 离线
|
『楼 主』:
敢向dos高手挑战的一个问题
使用 LLM 解释/回答一下
如何在进入edit,并且书写程序完毕后自动保存退出edit到dos的程序
简单的说,在dos环境中
c:\edit 1.bat
写入要写的程序(已经在edit中了)
按alt+f-x退出
一次性用批处理完成不需要人工参与。相当于一个自动演示
How to automatically save and exit edit to the DOS program after entering edit and finishing writing the program. Simply put, in the DOS environment:
c:\edit 1.bat
Write the program to be written (already in edit)
Press alt+f-x to exit
Complete it all at once with a batch file without manual intervention. It's equivalent to an automatic demonstration.
|
|
2005-8-13 15:14 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
看一下,EDIT有没有命令行参数,
再试试 > 和< 这些定向符.
感觉不是大问题..
Let's see, does EDIT have command-line parameters, and then try the > and < redirection characters. It doesn't seem like a big issue..
|
|
2005-8-13 16:40 |
|
|
xy2fengye
初级用户
 
积分 55
发帖 23
注册 2005-8-11
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
#83我要的就是这个步骤,必须进入edit界面中。不过还是谢谢你
#83 What I want is this step, I must enter the edit interface. But still thank you
|
|
2005-8-13 16:45 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
|
2005-8-13 18:29 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
刚才看清你的意思了, 这不可能吧..
因为EDIT一定要询问保存的,不保存就退出,他要弹出框的,.
不管你以何种方式打开EDIT,这时进程是在EDIT程序掌控中的,..
不可能改他的步骤,尤其是在DOS中..
I just now saw and understood your meaning, this can't be possible..
Because EDIT must ask for saving, if you don't save and exit, it will pop up a box..
No matter in which way you open EDIT, at this time the process is under the control of the EDIT program,..
It's impossible to change its steps, especially in DOS.
|
|
2005-8-13 18:57 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Re xy2fengye:
在我看来,这样做的意义不是很大,所以其挑战性便打了个折扣。
因为 EDIT 并不是用来处理文本流的工具,它具有典型的窗口菜单界面,使用菜单命令实现文本编辑,这是它的一个优势,当然也可能是一个劣势,然而这仍然是技术上的一个进步。
我们要通过自动化的脚本来控制文本编辑,EDIT从来就不是一个好的选择,甚至于很难成为一个选择。在这方面更胜任的是EDLIN.EXE——这个MS更早推出的工具,它曾经是批处理爱好者的挚爱,具有如同DEBUG.EXE一样的地位。虽然它曾一度消失,但是你现在仍然能从XP等NT系列平台下找到并运行它,也许它对你的问题有意向不到的帮助。
Re xy2fengye:
In my opinion, the significance of doing this is not very great, so its challenge is reduced.
Because EDIT is not a tool for processing text streams. It has a typical window menu interface, and uses menu commands to implement text editing. This is one of its advantages, and of course it may be a disadvantage, but this is still a technological advancement.
We need to control text editing through automated scripts. EDIT has never been a good choice, and it is even difficult to be an option. For this aspect, EDLIN.EXE, a tool launched earlier by MS, is more competent. It used to be the love of batch processing enthusiasts and had a status similar to DEBUG.EXE. Although it once disappeared, you can still find and run it on NT series platforms such as XP now. Maybe it can help you unexpectedly with your problem.
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-8-13 19:25 |
|
|
JonePeng
金牌会员
      D◎$ Fαп
积分 4562
发帖 1883
注册 2004-1-19 来自 广东广州
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
要做到楼主这种演示效果,我想到了用MSDOS 7.1超级启动盘里面的KPUSH。经过小小的试验,可以成功,但缺点是这个演示没有延时效果,键盘“动作”太快了,以致 edit 界面一闪而过。
我在以前的帖子里也对KPush牛刀小试一番,其实KPush的功能还比较强大的,它可以将最多127个字符送入键盘缓冲区,可以在命令行下模拟键盘输入。在默认状态下,键盘缓冲区大小为15个键(可以看作是15个字符),运行 kpush /e 则把缓冲区大小扩充至127个键,如果楼主要演示的1.bat文件不长,那么这127个键足以应付。试试以下的命令:
kpush /e
kpush "edit 1.bat" 13 "@echo KPUSH demo program." 13 "@echo Returned to DOS prompt." /33 "xy"
解释一下:
kpush /e -- 将缓冲区大小扩充至127个键
第二行的参数很多,其实这些参数都是模拟输入的字符和键盘扫描码。其中普通字符串必须用引号(单、双引号都行)括起来。“13”就是回车键的ASCII代码,后面的“/33”是 Alt+F 组合键的扫描码,对于像组合键、F1~F12等功能键,必须用“/”后接扫描码,以便区分普通键的ASCII代码。末尾的“xy”表示在按了 Alt+F 后,先按“x”,此时edit提示是否保存文件,然后再模拟按“y”键退出。要查询某个键的代码或扫描码,可以直接运行KPUSH,然后按任意键即可看到对应键的结果。
Last edited by JonePeng on 2005-8-13 at 21:05 ]
To achieve the demonstration effect like the LZ, I thought of using KPUSH from the MSDOS 7.1 super boot disk. After a little test, it can be successful, but the shortcoming is that this demonstration has no delay effect, and the keyboard "action" is too fast, so that the edit interface flashes by in a flash.
I also had a small try on KPUSH in my previous post. In fact, the function of KPUSH is relatively powerful. It can send up to 127 characters into the keyboard buffer, and can simulate keyboard input at the command line. In the default state, the size of the keyboard buffer is 15 keys (can be regarded as 15 characters). Running kpush /e expands the buffer size to 127 keys. If the 1.bat file to be demonstrated by the LZ is not long, then these 127 keys are enough. Try the following commands:
kpush /e
kpush "edit 1.bat" 13 "@echo KPUSH demo program." 13 "@echo Returned to DOS prompt." /33 "xy"
Explain:
kpush /e -- expand the buffer size to 127 keys
There are many parameters in the second line. In fact, these parameters are all characters and keyboard scan codes for simulation input. Among them, ordinary strings must be enclosed in quotes (single or double quotes are acceptable). "13" is the ASCII code of the enter key. The following "/33" is the scan code of the Alt+F combination key. For function keys such as combination keys, F1-F12, etc., you must use "/" followed by the scan code to distinguish the ASCII code of ordinary keys. The "xy" at the end means that after pressing Alt+F, press "x" first. At this time, the edit prompts whether to save the file, and then simulate pressing the "y" key to exit. To query the code or scan code of a certain key, you can directly run KPUSH and then press any key to see the result corresponding to the key.
Last edited by JonePeng on 2005-8-13 at 21:05 ]
|

----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
|
|
2005-8-13 21:03 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
楼主不要edlin,他要的就是Edit,演示嘛,他要给人演示如何用Edit写一个批处理(或者其它程序)。
个人感觉这也没有什么意义。如果Edit支持类似Office的宏功能,这是可以实现的。在Windows下也有类似的软件,例如Automate。但在DOS下,暂时还没有发现。
The LZ doesn't want edlin. What he wants is Edit, for demonstration purposes, he wants to demonstrate to people how to use Edit to write a batch file (or other program).
Personally, I feel this is of no significance. If Edit supports macro functions similar to Office, this can be achieved. There are similar software under Windows, such as Automate. But under DOS, I haven't found any yet.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2005-8-13 21:13 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
Re Climbing:
做 EDIT 的自动演示,不如索性用的屏幕截取软件,在命令行下录制输入过程为视频或动画了,虽然体积大一些,不过可以避免很多兼容上的问题,比如使用的环境不支持 edit 。
不过不知DOS下的录制软件有哪些可以直接录制生成自显示动画的?
Re Climbing:
Instead of making automatic demonstrations of EDIT, it might be better to use a screen capture software to record the input process as a video or animation under the command line. Although it is a bit larger in size, it can avoid many compatibility issues, such as the situation where the environment does not support EDIT.
But I don't know what screen recording software under DOS can directly record and generate self-display animations?
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-8-14 20:54 |
|
|
xy2fengye
初级用户
 
积分 55
发帖 23
注册 2005-8-11
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
大家好,我想出这个题目的原由是这样的
因为我们有时候不想总是用edit(如果你从来不用的话)打开它,编写程序在保存-----退出-----确定退出。真的有些麻烦。如果我们通做个批处理。岂不是简单省了不少的事吗。
顺便问一下,你们编写批处理用什么工具(dos中)。
Hello everyone. The reason I came up with this topic is like this. Because sometimes we don't want to always use edit (if you never use it) to open it, write a program, save - exit - confirm exit. It's really a bit troublesome. If we make a batch file, isn't it simple and saves a lot of things? By the way, what tools do you use to write batch files in DOS?
|
|
2005-8-14 21:31 |
|
|
wqvbbjiq
初级用户
 
积分 24
发帖 20
注册 2005-8-14
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
因为EDIT要询问保存的,不保存就退出,他要弹出框的,.
不管你以何种方式打开EDIT,不可能改他的步骤,使用DOS
Because EDIT will ask for saving; if you don't save, it will exit, and it will pop up a box. No matter in which way you open EDIT, you can't change its steps. Use DOS.
|
|
2005-8-14 22:09 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
Re xy2fengye:
如果你指的是如何在命令行下或者批处理中生成批处理程序或者文本文件,可以参考以下的链接:
{16833}dos命令有几种方式生成文本文件(*.txt)
如果你是想通过批处理编辑某些文件,那么我仍建议你使用edlin,或者使用第三方提供的工具,例如 sed。另外,Debug 也有简单地编辑文本的功能。
Re xy2fengye:
If you are referring to how to generate batch programs or text files in the command line or batch processing, you can refer to the following link:
{16833}Several ways for dos commands to generate text files (*.txt)
If you want to edit some files through batch processing, I still suggest using edlin, or using third-party provided tools such as sed. In addition, Debug also has a simple function to edit text.
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-8-14 22:39 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
Originally posted by xy2fengye at 2005-8-14 21:31:
大家好,我想出这个题目的原由是这样的
因为我们有时候不想总是用edit(如果你从来不用的话)打开它,编写程序在保存-----退出-----确定退出。真的有 ...
我在DOS下编写东西就是用Edit,我觉得它挺好用的,一点儿也不让人觉得麻烦,如果你嫌它麻烦,好象Bart的工具盘中提供一个Edit程序,那个程序可以直接按Alt+X保存退出,Alt+Q则不保存退出。另外好象还有Qedit或者Vim这一类的编辑工具。
I use Edit to write things under DOS. I think it's quite easy to use, and it doesn't make people feel troublesome at all. If you find it troublesome, it seems that Bart's tool disk provides an Edit program. That program can directly press Alt+X to save and exit, and Alt+Q to exit without saving. Also, there seem to be editing tools like Qedit or Vim.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2005-8-16 10:45 |
|