Put the OPEN check in the file name entry loop

by (Login burger2227)
R

 

DO
LOCATE 4, 8: INPUT "Enter Trump deck name : "; nme$
IF LEN(nme$) THEN
OPEN "C:\" + nme$ + ".txt" FOR RANDOM AS #1 LEN = LEN(newcard)
IF LOF(1) THEN ' data found
EXIT DO ' ONLY way out of loop
ELSE : CLOSE #1: KILL "C:\" + nme$ + ".txt"
END IF
END IF
LOOP

NOTE: You are working in a BAD directory! Qbasic and your programs should be placed in a new folder off of C:, like C:\Qbasic. BAD things could happen there because Windows may actually have empty files there.

Ted



    
This message has been edited by burger2227 on Jan 6, 2010 9:10 PM

Posted on Jan 6, 2010, 3:44 PM

Respond to this message   

Return to Index

Response TitleAuthor and Date
Sorted....unseenmachine on Jan 6

 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement