我正在使用GTuner语言和GTuner IV 1.1编译器。我的代码似乎在编译后仍会继续输出警告
GPC错误:PressXInput.gpc(18):声明语法错误'combo'
使用GTuner编译(泰坦二号)
任何有助于修复语法声明错误的信息,甚至可以改善我的代码。
试图将'combo'声明为@ECHO OFF
SETLOCAL
SET "sourcedir=C:\Test"
SET "destdir=C:\Test"
SET "filename1=%sourcedir%\TestOutput.txt"
SET "outfile=%destdir%\TestOutputFixed.txt"
SET "hotsection="
CALL :clear$
(
FOR /f "usebackqdelims=" %%a IN ("%filename1%") DO (
rem if line contains `<SubtitleTrack>` we've entered hot section
ECHO "%%a"|FIND "<SubtitleTrack>">NUL
IF NOT ERRORLEVEL 1 SET "hotsection=y"
SET "saved="
IF DEFINED hotsection (
FOR /L %%r IN (100,1,999) DO IF NOT DEFINED saved IF NOT DEFINED $%%r SET "$%%r=%%a"&SET "saved=Y"
rem if line contains `</SubtitleTrack>` or `</SubtitleTracks>` then end-of-hotsection
SET "endhot="
SET "endtrack="
FOR /f "tokens=1delims= " %%w IN ("%%a") DO FOR %%x IN ("</SubtitleTrack>") DO IF "%%w"==%%x SET "endhot=Y"&IF
"</SubtitleTracks>"==%%x SET "endtrack=Y"
IF DEFINED endhot (
rem end-of-hotsection
rem check whether we have SourceID 0 and TrackNumber 1
SET "id0="&SET "track1="
FOR /f "tokens=1,*delims== " %%r IN ('SET $') DO (
IF "%%s"==""<SourceId>0" SET "id0=Y"
IF "%%s"==""<TrackNumber>1" SET "track1=Y"
)
rem found end-of-hotsection. now regurgitate saved lines and set `default` appropriately
FOR /f "tokens=2delims==" %%r IN ('SET $') DO (
echo "%%r"|FINDSTR /r /c:" *\<Default>" >NUL
IF ERRORLEVEL 1 (ECHO %%r) ELSE (
FOR /f "tokens=1delims=:" %%s IN ("%%r") DO (
IF defined track1 (IF DEFINED id0 (ECHO %%s true,) ELSE (ECHO %%s false,)) ELSE (ECHO %%s false,)
)
)
CALL :clear$
IF DEFINED endtrack SET "hotsection="
)
)
) ELSE (ECHO %%a)
)
)>"%outfile%"
GOTO :EOF
:clear$
:: remove variables starting $
FOR /F "delims==" %%z In ('set $ 2^>Nul') DO SET "%%z="
GOTO :EOF
等,但仍然是相同的错误。
bool/int
预期的结果在编译后应该不会显示带有'combo'的声明语法错误。
答案 0 :(得分:0)
组合必须在main {}之外声明。
`
bool toggle;
main {
if (event_active (BUTTON_2)) {
toggle = !toggle;
combo_stop(PressX);
}
if (toggle) {
combo_run(PressX);
}
}
combo PressX {
set_val(BUTTON_16, 100.0);
wait(100);
wait(5000);
}
`