热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

录制宏的IDE优势是什么?-WhataretheIDEadvantagesofrecordedmacros?

Justasthetitlesays,Iseealotofeditorstoutingmacrorecordingasafeaturebutcannotfind

Just as the title says, I see a lot of editors touting macro recording as a feature but cannot find a way to take advantage of these functions myself. So what can you use it for? The type where you can record mouse movement and/or keystrokes? Is it really that helpful to people out there? Specifically, I deal with Eclipse which has a number of built in "fill in" functions, so I really don't see what the advantages could be.

正如标题所说,我看到很多编辑都在宣传宏录制作为一项功能,但却无法找到利用这些功能的方法。那么你可以用它做什么?您可以记录鼠标移动和/或击键的类型?这对那里的人真有帮助吗?具体来说,我处理Eclipse有许多内置的“填充”功能,所以我真的看不出有什么优势。

6 个解决方案

#1


I use them all the time. Say, for example, I want to go down a list, indenting by 4 and adding a "|* ". In EMACS, I hit C-x ( to start recording, do one example line to see that it's what I want, ending with C-n C-a to move to the next line, and end the macro with C-x ). Then C-x e repeats it line by line, and C-u number C-x e does it many times.

我一直都在使用它们。比方说,我想在列表中下移,缩进4并添加“| *”。在EMACS中,我点击C-x(开始录制,做一个示例行,看看它是我想要的,以C-n C-a结束移动到下一行,并用C-x结束宏)。然后C-x e逐行重复,C-u数C-x e多次重复。

#2


Depends on what you are doing and what language you are work with. As a simple example, right now I am working with a Visual Basic .NET application that has a number of queries in it. I generally do all of my work with queries in Toad, but Visual Basic .NET has an annoying syntax when it comes to long strings, namely:

取决于您正在做什么以及您使用的语言。作为一个简单的例子,我现在正在使用一个Visual Basic .NET应用程序,其中包含许多查询。我通常在Toad中使用查询来完成所有工作,但是当涉及到长字符串时,Visual Basic .NET有一个恼人的语法,即:

Public Const SelectData As String = _
"SELECT * " & _
"FROM myTable " & _ 
"WHERE myField = :SOMETHING"

Since I really don't like editing the queries when I copy them out of the code or pasting them back in, I have some macros that will automatically format or strip the formatting from them.

因为我真的不喜欢编辑查询,当我将它们从代码中复制出来或粘贴回来时,我有一些宏会自动格式化或从中删除格式。

Also, some of the macros can be used to automate common tasks that you need to do around the IDE while you are working. Any sequence of commands that you see yourself doing often is something that you can turn into a macro and do with just a single click.

此外,某些宏可用于自动执行在您工作时围绕IDE执行的常见任务。您经常看到的任何命令序列都可以转换为宏,只需单击即可完成。

#3


Waaaay back I used a macro to make function header/comments. Other than that I have not used them.

Waaaay回来我使用宏来制作函数标题/注释。除此之外,我没有使用它们。

Basically you can "automate" tedious things you do often that do not have built in ways to do the tasks you do frequently. It is a flexible way to give lots of power to people so they can work more efficiently.

基本上,您可以“自动化”经常执行的繁琐工作,这些工作没有内置的方法来执行您经常执行的任务。这是一种灵活的方式,可以为人们提供更多的权力,使他们能够更有效地工作。

#4


I find it very useful in microsoft excel. Rather then having to look through documentation to find every object and function I need to call I can record a macro that does most of what I want, take that code and modify it to give me finer control.

我发现它在microsoft excel中非常有用。而不是必须通过文档来查找我需要调用的每个对象和函数我可以记录一个宏,它可以完成我想要的大部分工作,获取代码并修改它以给我更好的控制。

#5


In Visual Studio, I use macros for many different purposes. One of the most valuable comes when debugging Windows service. I can use the macro engine to start and then attach to the Windows service which just a click of a button.

在Visual Studio中,我将宏用于许多不同的目的。调试Windows服务时最有价值的一个。我可以使用宏引擎启动,然后只需单击一个按钮即可连接到Windows服务。

Also, sometimes I use custom DEFINES that need to be exploded into code--sort of like C/C++ macros.

此外,有时我使用需要分解成代码的自定义DEFINES - 有点像C / C ++宏。

Colby Africa

#6


I don't use them in Eclipse either. Here's why:

我也不在Eclipse中使用它们。原因如下:

  1. Eclipse has many powerful built-in functions and refactorings. So with code, its not necessary.

    Eclipse有许多强大的内置函数和重构。所以使用代码,它没有必要。

  2. Eclipse macros aren't that great. You can record them, but its hard to tweak them and do exactly what you want.

    Eclipse宏不是很好。你可以录制它们,但很难调整它们并完全按照你的意愿行事。

  3. Macros become more useful in things like modifying files that aren't code. For that I tend to use something like vim. Also, you have to actually practice using macros to recognize when they will help.

    宏在修改非代码的文件等方面变得更有用。为此,我倾向于使用像vim这样的东西。此外,您必须实际使用宏来识别它们何时会有所帮助。


推荐阅读
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • Windows服务与数据库交互问题解析
    本文探讨了在Windows 10(64位)环境下开发的Windows服务,旨在定期向本地MS SQL Server (v.11)插入记录。尽管服务已成功安装并运行,但记录并未正确插入。我们将详细分析可能的原因及解决方案。 ... [详细]
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • 本文探讨了如何在 React 和 TypeScript 中使用高阶组件(HOC)来消耗上下文,并详细解释了相关类型定义和实现细节。 ... [详细]
  • 本文详细介绍了如何使用 Yii2 的 GridView 组件在列表页面实现数据的直接编辑功能。通过具体的代码示例和步骤,帮助开发者快速掌握这一实用技巧。 ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • 深入解析Spring Cloud Ribbon负载均衡机制
    本文详细介绍了Spring Cloud中的Ribbon组件如何实现服务调用的负载均衡。通过分析其工作原理、源码结构及配置方式,帮助读者理解Ribbon在分布式系统中的重要作用。 ... [详细]
  • 本文详细介绍了Akka中的BackoffSupervisor机制,探讨其在处理持久化失败和Actor重启时的应用。通过具体示例,展示了如何配置和使用BackoffSupervisor以实现更细粒度的异常处理。 ... [详细]
  • 本文详细介绍了Java编程语言中的核心概念和常见面试问题,包括集合类、数据结构、线程处理、Java虚拟机(JVM)、HTTP协议以及Git操作等方面的内容。通过深入分析每个主题,帮助读者更好地理解Java的关键特性和最佳实践。 ... [详细]
  • DNN Community 和 Professional 版本的主要差异
    本文详细解析了 DotNetNuke (DNN) 的两种主要版本:Community 和 Professional。通过对比两者的功能和附加组件,帮助用户选择最适合其需求的版本。 ... [详细]
  • 本文探讨了Hive中内部表和外部表的区别及其在HDFS上的路径映射,详细解释了两者的创建、加载及删除操作,并提供了查看表详细信息的方法。通过对比这两种表类型,帮助读者理解如何更好地管理和保护数据。 ... [详细]
  • 主要用了2个类来实现的,话不多说,直接看运行结果,然后在奉上源代码1.Index.javaimportjava.awt.Color;im ... [详细]
  • 本文介绍了如何使用JQuery实现省市二级联动和表单验证。首先,通过change事件监听用户选择的省份,并动态加载对应的城市列表。其次,详细讲解了使用Validation插件进行表单验证的方法,包括内置规则、自定义规则及实时验证功能。 ... [详细]
  • 本文探讨了如何在发布 XenApp 应用时,通过命令行参数实现启动时的参数传递。特别介绍了静态和动态参数传递的方法,并详细解释了 ICA 文件中两种参数传递方式的区别及安全检查机制。 ... [详细]
  • 如何高效创建和使用字体图标
    在Web和移动开发中,为什么选择字体图标?主要原因是其卓越的性能,可以显著减少HTTP请求并优化页面加载速度。本文详细介绍了从设计到应用的字体图标制作流程,并提供了专业建议。 ... [详细]
author-avatar
烂哥居士
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有