Talk:Readline interface: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎What is meant by "history"?: add comment about ''up-arrow'' key being used for command retrieval. -- ~~~~)
m (→‎What is meant by "history"?: added comments about which key is used for command retrieval. -- ~~~~)
Line 4: Line 4:
: No. History is pressing the up arrow to retrieve a previously-typed command (one of a sequence of them in fact) that you can then run again, or edit before submitting. It ''greatly'' improves the productivity and usability of a command-line interface. –[[User:Dkf|Donal Fellows]] 03:26, 9 December 2011 (UTC)
: No. History is pressing the up arrow to retrieve a previously-typed command (one of a sequence of them in fact) that you can then run again, or edit before submitting. It ''greatly'' improves the productivity and usability of a command-line interface. –[[User:Dkf|Donal Fellows]] 03:26, 9 December 2011 (UTC)


:: ''History'' shouldn't be limited to the ''up arrow'' key. On earlier VM/CMS systems, system programmers (almost everywhere) added a ROY implementation [of the latter-named RETREIVE function] to the SysReq key (so as to not preclude taking over any "useful" key), but the SysReq key was later perloined by VTAM, but by that time, IBM VM/CMS had implemented the RETRIEVE function to any PFK (program function key) that the user choose, and it was later assigned by some programs to PF6/PF18 such as XEDIT and others, so most users choose that key which made it easier to remember to use that key everywhere for retrieving commands. Nowadays, it seems almost silly to discuss the usefullness of it, but at one time, there was no such animal. -- [[User:Gerard Schildberger|Gerard Schildberger]] 17:32, 1 June 2012 (UTC)
:: ''History'' shouldn't be limited to the ''up arrow'' key. On earlier VM/CMS systems, system programmers (almost everywhere) added a ROY (by way of a modification to the VM control program [CP]) implementation [of the latter-named RETREIVE function] to the '''SysReq''' key (so as to not preclude taking over any "useful" key --- there weren't any ''arrow'' keys at that time. But the '''SysReq''' key was later purloined by VTAM, but by that time, IBM VM/CMS system had implemented the RETRIEVE function to any PFK (program function key) that the user choose, and it was later assigned by some programs to PF6/PF18 such as XEDIT and others, so most users choose that key which made it easier to remember which key to use for retrieving commands. Nowadays, it seems almost silly to even discuss the usefullness of it, but at one time, there was no such animal. Even much much later, DOS seemed to add it as an afterthought. -- [[User:Gerard Schildberger|Gerard Schildberger]] 17:32, 1 June 2012 (UTC)


==a simple program ...==
==a simple program ...==

Revision as of 17:41, 1 June 2012

What is meant by "history"?

Is history simply not removing what is in the console when a new command is run? --Crazyfirex 21:26, 8 December 2011 (UTC)

No. History is pressing the up arrow to retrieve a previously-typed command (one of a sequence of them in fact) that you can then run again, or edit before submitting. It greatly improves the productivity and usability of a command-line interface. –Donal Fellows 03:26, 9 December 2011 (UTC)
History shouldn't be limited to the up arrow key. On earlier VM/CMS systems, system programmers (almost everywhere) added a ROY (by way of a modification to the VM control program [CP]) implementation [of the latter-named RETREIVE function] to the SysReq key (so as to not preclude taking over any "useful" key --- there weren't any arrow keys at that time. But the SysReq key was later purloined by VTAM, but by that time, IBM VM/CMS system had implemented the RETRIEVE function to any PFK (program function key) that the user choose, and it was later assigned by some programs to PF6/PF18 such as XEDIT and others, so most users choose that key which made it easier to remember which key to use for retrieving commands. Nowadays, it seems almost silly to even discuss the usefullness of it, but at one time, there was no such animal. Even much much later, DOS seemed to add it as an afterthought. -- Gerard Schildberger 17:32, 1 June 2012 (UTC)

a simple program ...

I think anyone attempting this task will soon find that's it not simple to provide a "history" suitable for re-doing commands. Witness Microsoft's DOS with its up arrow (retrieve/re-do) function along with all the F1 --> F12 functions, the latter being too complicated to use and hard to remember which function key does what (I still ponder, what where those coders thinking?). I was going to add such functionality to the REXX example, but the code would've been far from simple. So I elected to just have the option for the user to list the history of all commands entered, and let the user pick which one (by number), or just choose the last command to re-execute. I couldn't added more support to just limit the last n entries (for the command history), and/or let the user choose how many commands to list. But again, that would've added more complexity to an already burgeoning program, and the goal of the task was to implement a simple (ha!, good luck with that!) program, and in that, I fear, I may have failed. I hope I showed how to add commands, handle aliases, and full abbreviations (modeled after IBM VM/CMS version of what abbreviations are). Of course, one man's simple program is another's monstrosity. -- Gerard Schildberger 17:12, 1 June 2012 (UTC)