A func.bas makes a func.exe - Can I Call(SHELL?) to func.exe? - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: A func.bas makes a func.exe - Can I Call(SHELL?) to func.exe? (/showthread.php?tid=406) |
A func.bas makes a func.exe - Can I Call(SHELL?) to func.exe? - dcromley - 05-13-2022 Sub: A func.bas makes a func.exe - Can I SHELL to func.exe? Yes I can, but it is SLOW. My func.bas program is msecs.bas, which gets milliseconds since midnight. Program 1 shows that the API call is FAST. BUT I don't want to have all the baggage (Type..End Type, Declare..EndDeclare, Function..EndFunction), I'd rather compile it and call (SHELL?) it. Code: (Select All) _Title "Test IncodeMsecs" Program 2 is THE msecs.bas (with the baggage) which makes msecs.exe which returns milliseconds: Code: (Select All) _Title "msecs" Program 3 (without the baggage) shows that IT WORKS, but is SLOW. You spend 1000 ms to get the current ms. Code: (Select All) _Title "Test2 msecs" 1) I don't want to hear about something like that _Millisecs() already exists -- I want to pursue doing this. [ I found out about Timer(.001) ! ] 2) Apparently msecs.exe is not staying in memory - is being re-loaded each call. 3) Apparently msecs.exe is opening/closing an unused/unwanted console window. 4) This makes it SLOW. Can I fix these issues? I would appreciate your solutions. RE: A func.bas makes a func.exe - Can I Call(SHELL?) to func.exe? - SMcNeill - 05-13-2022 You're shelling to an external program, opening that program, running that program, closing that program... Of course it's going to be slow -- that's a lot of system calls to be making to get your result. Instead, find some other way for your programs to communicate, without having to shell/load/run/close them each time you want something from them. https://qb64phoenix.com/forum/showthread.php?tid=302 -- -like here, my mini messenger is using open connection to chat with each other. If you've got a RAM Drive up and going, you could always write the data to a file with the first program, and then read the data with the second program, as needed. (I wouldn't want to beat my poor hard drive to death using such a means of interaction, but it'd be easy to do with a ram drive.) RE: A func.bas makes a func.exe - Can I Call(SHELL?) to func.exe? - dcromley - 05-13-2022 > SMcNeill: " .. my mini messenger .. " So far I've chatted with myself (2 windows), but not my wife upstairs. I'll be looking at this. Thanks. > " .. RAM Drive .. " I had one, but don't now, I will consider that. Thanks. Please give me a link to an example or something to find out how to not have a console and just return a number (System [return_code%]). |