Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List of files
#11
Moneo's idea: It seems a bit inconvenient for an editor where you can save and load files, unless you make the editor update every time something is saved. Simple, but a little inconvenient, and the files are only intended to be remembered temporarily before disappearing(memory constraints).
am part of the legion of n00b. We are numerous if dumb. We will enslave you all!
Reply
#12
Code:
shell "dir *.* /b /on /a-d /-p > tempfile.tmp"
open "tempfile.tmp" for input as #1
'Read it until eof
close #1
kill "tempfile.tmp"

Can be called whenever you want, inside the program.


> redirects the output to a file instead of the screen, so it wont exit VESA mode.

To append data to an existing file, use >>


Also, look up all DIR parameters, and disable ALL that you wont use, as you can have pre-set paraeters defined, and you never know what someone has set.

To disable a switch, add a - infront of it, example:
dir /-p
Reply
#13
Neo, you were a little rough on Oz. "Maybe you should start reading"

True, Oz was not a clear as z!re regarding the fact that the redirection avoids the VESA problem, but otherwise it was a good answer.

Too bad z!re didn't reply first. This could have been a two-post thread. (Maybe one more for the OPs thank-you).

Mac
Reply
#14
Mac: what Neo said was perfectly acceptable. It wasn't even remotely rough. You want rough? Here's rough:

"Go back to first grade and learn to read, maybe then you'll be useful."

Not that's rough.
I'd knock on wood, but my desk is particle board.
Reply
#15
Quote:> redirects the output to a file instead of the screen, so it wont exit VESA mode.
I have tested this myself, and came to the conclusion that SBM Production's problem is valid, as the usage of SHELL "DIR" of any kind exits VESA mode, and can even crash the computer while in vesa (yes... experienced myself). I tested it using uGL.

I completely disagree with Mac on all relevant points in his post, as obviously some more complex code was needed here. Redirection doesn't avoid the vesa problem at all. About the 2-post theory, who ever defined 2-post-topics as being good?
Reply
#16
I used SHELL DIR > in Novix a lot, Novix was VESA, worked fine.

It doesent change the screen mode, thats why it crashes in VESA when it tries to dump console text to the screen.

If you redirect it to a file it never tries to dump to the screen.

SHELL does NOT change gfx mode or affect the current mode in ANY way.
Reply
#17
=) I appreciate your answer Z!re ^_^. I came to think it might be an OS difference (9x/NT/2K/XP ?).

Anyway, I just took one of the uGL examples (for example the line drawing one), which works perfectly normally. Then I add a line "shell "dir *.* /b /on /a-d /-p > tempfile.tmp"" to the code, which will be executed while vesa mode is active, and the program just quits. Didn't show lines or something, as it did without the SHELL command. Running Win2K.

I guess it's an OS difference... or my OS is just weird Wink.
Reply
#18
Interesting. Any chance the DIR was writing something to SYSERR on that system?

Was the temporary file you created valid-looking? (Didn't bomb out for some reason).

Just wondering

Mac

dir /q >c:\temp\x 2>&1
This will trap the error message that q is illegal

I have found some DIR parameters are legal at my DOS prompt but not legal within SHELL. Command vs cmd stuff, I guess.

Unfortunately, I cant get the stderr redirection to work within SHELL
Reply
#19
Quote:Moneo's idea: It seems a bit inconvenient for an editor where you can save and load files, unless you make the editor update every time something is saved. Simple, but a little inconvenient, and the files are only intended to be remembered temporarily before disappearing(memory constraints).
Oh, didn't know it was an editor where you could be adding and deleting files while still running the editor. Yes, it would be a little inconvenient to have to exit the editor anytime you added or deleted a file.

Then perhaps you should try Zire's suggestion using the SHELL. It should work, if not, you could reconsider my batch file approach.
*****
Reply
#20
VESA modes can behave very strangely with DOS boxes

I can run with no problem my old jpeg viewer in a DOS box. But if I run one of the Jark's raytracers while WMP is playing music, my computer reboots. Strange...

Both programs share the same SUB for setting pixels, only Jark's is slightly modified to take into account 24bit modes.
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)