Code: Select all
CLS
LOCATE 1,1
INPUT "Actor name, or part of one:", sactname$
if sactname$ = actname$ then
SHELL "cd C:\ZSOACTRDAT"
SHELL "FIND /I ",sactname$ "Actordat.txt
sleep 10
INPUT #1, actname$, groupnum$, actornum$, pactnum$
CLOSE #1
Code: Select all
CLS
LOCATE 1,1
INPUT "Actor name, or part of one:", sactname$
if sactname$ = actname$ then
SHELL "cd C:\ZSOACTRDAT"
SHELL "FIND /I ",sactname$ "Actordat.txt
sleep 10
INPUT #1, actname$, groupnum$, actornum$, pactnum$
CLOSE #1
Code: Select all
SHELL "cd C:\ZSOACTRDAT"
Code: Select all
CHDIR "C:\ZSOACTRDAT"
Code: Select all
SHELL "FIND /I ",sactname$ "Actordat.txt
Code: Select all
SHELL "FIND /I " + sactname$ + " Actordat.txt"
Code: Select all
DIM FH AS INTEGER
FH = FREEFILE
OPEN "MYFILE.TXT" FOR INPUT AS #FH
Code: Select all
INPUT "Actor name, or part of one:", sactname$
Code: Select all
INPUT "Actor name, or part of one:"; sactname$
Code: Select all
'Actor database of ZSO
CLS
Wbackround:
for i = 1 to 300
Color 0,15
Locate 15,20
PRint "Loading, Please wait."
for b = 1 to 30000
next b
CLS
Locate 15,20
PRint "Loading, Please wait.."
for c = 1 to 30000
next c
CLS
Locate 15,20
PRint "Loading, Please wait..."
for d = 1 to 30000
next d
CLS
next i
CLS
test:
Color 0,15
Locate 1,1
Print "A production of Souylsin."
Locate 2,1
Print "A find by the community of ZSO."
Locate 3,1
PRINT "ZSO DAT 0.01"
Locate 4,1
Print "Locating Actordat..."
Open "Actordat.txt" for INPUT as #1
INPUT #1, there$
CLOSE #1
if there$ = "0000 0000 Link (may sometimes cause Z-buffer glitches)" then
goto con
else
LOCATE 5,1
PRINT "Could not locate Actordat, now exitting..."
sleep 1
end
end if
con:
do
Locate 5,1
PRINT there$
LOCATE 6,1
PRINT LEN(there$)
Locate 7,1
PRINT "Actordat Located successfully"
LOCATE 8,1
PRINT "Press C to Continue"
kp$ = INKEY$
if kp$ = "c" then goto confrm
loop
confrm:
CLS
DO
LOCATE 15,20
PRINT "TEST COMPLETE"
kp$ = INKEY$
if kp$ = "d" then goto Menu
LOOP
Menu:
CLS
do
LOCATE 10, 20
PRINT "Database of Zelda Actors"
LOCATE 20, 5
PRINT "(S)earch for Actors"
LOCATE 20, 20
PRINT "(E)xit"
kp$ = INKEY$
if kp$ = "s" then goto srcaktr
if kp$ = "e" then goto ext
loop
srcaktr:
CLS
LOCATE 1,1
INPUT "Actor name, or part of one:", sactname$
if sactname$ = actname$ then
SHELL "cd C:\ZSOACTRDAT"
SHELL "FIND /I " + sactname$ + "Actordat.txt
sleep 10
INPUT #1, actname$, groupnum$, actornum$, pactnum$
CLOSE #1
ext:
end
OPEN "Actordat.txt" FOR INPUT AS #1Lee wrote:Ill post the whole program right now
Code: Select all
CONST ActorFile = "C:\ZSOACTRS\Actordat.txt"
DIM SHARED MyErr AS INTEGER
MyErr = 0: ON ERROR GOTO GetMyErr
OPEN ActorFile FOR INPUT AS #1
ON ERROR GOTO 0
IF MyErr > 0 THEN PRINT "Unable to find "; ActorFile: SYSTEM
' Test format
DO WHILE NOT EOF(1)
FOR i = 1 TO 4
IF EOF(1) THEN
PRINT "Format error in "; ActorFile
SYSTEM
ELSE
INPUT #1, l$
END IF
NEXT i
LOOP
CLOSE #1
' OK, there is a good file
CLS
DO
PRINT : LINE INPUT "Actor name, or part of one: ", sactname$
IF sactname$ = "" THEN EXIT DO
GotIt = 0
OPEN ActorFile FOR INPUT AS #1
DO WHILE NOT EOF(1)
INPUT #1, actname$
IF INSTR(UCASE$(actname$), UCASE$(sactname$)) > 0 THEN GotIt = -1: EXIT DO
FOR i = 1 TO 3: INPUT #1, l$: NEXT i
LOOP
IF GotIt THEN
INPUT #1, groupnum$, actornum$, pactnum$
PRINT "Found "; actname$; " "; groupnum$; " "; actornum$; " "; pactnum$
ELSE
PRINT "Unable to find "; sactname$
END IF
CLOSE #1
LOOP
PRINT "End of Run"
SYSTEM
GetMyErr: MyErr = ERR: RESUME NEXT
Code: Select all
cmd$ = "FIND /I " + CHR$(34) + sactname$ + CHR$(34) + " Actordat.txt"
Code: Select all
SHELL "cd C:\ZSOACTRDAT"
you mean theBelow is some working code that abandons the SHELL concept, as suggested by Nodtveidt. It will work assuming you have the file and it contains stuff like
"John Smith", "Group1","34343","12"
"Mary Jones", "Group2","22","22"
"John Brown", "Group3","3437","43"
Don't know what you mean by that. But when you get tired messing around, try this:Lee wrote:what im trying to do is search for none variable strings, which cannot be done in QB without teh SHELL command.
Code: Select all
"John Smith", "Group1","34343","12"
"Mary Jones", "Group2","22","22"
"John Brown", "Group3","3437","43"