douhuo3696 2010-12-21 21:15
浏览 40
已采纳

SciTE中的多行command.go

The Short

This deals with SciTE and the go language in Windows (in particular, Windows 7). This is my first time using SciTE, so if there is another way to achieve my goal that is fine as well.

Goal: With one key press, compile, link, and execute the newly created binary.

The Long

I want to setup the compile/link/excecute under the "go" command in SciTE. This may be slightly confusing as it is also for the go language. Here is what I have so far:

command.compile.*.go=8g $(FileNameExt)
command.build.*.go=8l -o $(FileName).exe $(FileName).8
command.go.*.go=$(FileName).exe

What I would like is to have something like:

command.go.*.go=\
8g $(FileNamExt)\
8l -o $(FileName).exe $(FileName).8\
$(FileName).exe

If this worked the way I intended it would compile the file, link it, and then run the executable. What happens is:

8g hello.go8l -o hello.exe hello.8hello.exe

When it should be:

8g hello.go
8l -o hello.exe hello.8
hello.exe

Where each line is executed.

  • 写回答

2条回答 默认 最新

  • dongtu4028 2010-12-22 03:09
    关注

    Write a batch script like so:

    @echo off
    if (%1 == "") (goto end)
    
    set gofile=%1%
    shift
    
    8g %gofile%.go
    8l -o %gofile%.exe %gofile%.8
    %gofile%.exe
    
    :end
    

    The batch file can be anywhere, but let's say it's in 'C:\one\two\three\GO.bat' sans the quotes. In the SciTE property file change:

    command.go.*.go=$(FileName).exe
    

    to

    command.go.*.go=C:\one\two\three\GO.bat $(FileName)
    

    And when you hit F5 or click on "Go", it will compile, link, and execute the file.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀