なんとなく気になってもう少しサンプルを作ってみようと思いました。
なるべく単純プログラムで。
----
; pipeexec研究
#include "hspext.as"
button gosub "pipeexec1", *PipeExec1
stop
*PipeExec1
; 標準出力値を格納する文字列
sdim buf1, 50
sdim buf2, 50
; 実行
pipeexec buf1, "test.bat"
; 実行中、回り続けるループ
repeat
; pipeexecしたプログラムの様子伺い
pipeget buf2
if(stat=0){
mes "- 1 -"
mes buf1
mes "- 2 -"
mes buf2
break
}
; 少し間を空ける
wait 50
loop
mes "終了"
return
----
test.batの内容
----
@echo off
echo 1234567890
exit 99
----
pipeexecに渡す1つ目の引数は、標準出力です。buf1。
pipegetに渡す引数も、標準出力。buf2。
この場合の結果は、次のとおり
----
- 1 -
1234567890
- 2 -
1234567890
----
pipegetのヘルプを見てみると、引数の説明は、
結果が格納される文字列型変数名
とあります。
この場合だと、99が入っていたら何かに使えるような気がしますが、
buf2も「1234567890」だと、存在価値がよくわからないなぁ。。。

解決せず問題提起だけで今日は終了
