If Command(1) = "NewWindow" then ScreenRes 640, 480, 32 For a as Integer = 1 to 100 Shell "echo String " & STR(a) Sleep 2000 Next a End 0 Endif Function DeGui_GetExeName() as String Dim as Integer Position For a as Integer = 1 to Len(Command(0)) If Mid(Command(0), a, 1) = "/" Or Mid(Command(0), a, 1) = "\" then Position = a Next a Return Mid(Command(0), Position + 1) End Function Sub OPipe(CB as ANY PTR) Print "StartThread" Dim as Integer P = FreeFile Dim as String s #IFDEF __FB_WIN32__ Open Pipe DeGui_GetExeName & " NewWindow" For Input as #P #ENDIF #IFDEF __FB_LINUX__ Open Pipe "./" & DeGui_GetExeName & " NewWindow" For Input as #P #ENDIF Do Until EOF(P) Line Input #P, s If s <> "" then Print s Loop Close #P Print "Thread End" Sleep End Sub ThreadCreate(@OPipe) Dim as Integer Counter While(NOT Multikey(&h01)) Counter += 1 Print Counter Wend