popenin.bas

来自「由一个古老的BASIC解释器改进而成, 保留了ANSI C固有的艺术美感.」· BAS 代码 · 共 26 行

BAS
26
字号
rem popenin.bas

if osfamily$ = "windows" then co$= "dir /b" else co$= "ls"

popen co$ for input as #1
print "Opened"

n= 0
maxn= 5000
dim a$ (maxn)

while not eof (1) and n < maxn
	n= n + 1
	line input #1, l$
	a$ (n)= l$
wend
close 1
print "Closed"


for i= 1 to n
	print a$ (i)
next

end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?