TWO THINGS....

 BBS: Inland Empire Archive
Date: 06-11-93 (17:55)             Number: 287
From: GEOFFREY LIU                 Refer#: NONE
  To: CALVIN FRENCH                 Recvd: NO  
Subj: TWO THINGS....                  Conf: (2) Quik_Bas
CF>First, someone (awhile back) posted a QB replacement for PDS'
CF>"FILE$" statement. I really need it now <gulp>... Anyone have
CF>it?

        This is my version, same thing as the FILE$, but also returns
the error code.

DECLARE FUNCTION WildCard$ (GLfilename$, GLFlag%)
'$INCLUDE: 'qb.bi'
'DEFINT A-Z
'b = 0
'PRINT
'a$ = WildCard$("C:\*.*", b)
'DO
'    IF b <> 0 THEN
'        EXIT DO
'    END IF
'    PRINT a$
'    a$ = WildCard$("", b)
'LOOP

DEFINT A-Z
FUNCTION WildCard$ (GLfilename$, GLFlag%)
'
' Returns filenames with wildcards
'
' GLFilename$ is name of file. *,? ok
' GLfilename$ = "" if second and subsequent calls with same
'   GLFilename$ (FindNext instead of FindFirst)
'
' Returns: If sucessful, ASCII filename (Strips extra nulls)
' if failed, in GLFlag:2 is file not found,3 is path not found,
' 12h is no more files
' Changes GLflag to 0 if sucessful
'
' NOTE: DON'T CHANGE THE DTA BETWEEN CALLS!
'

STATIC GLDTa AS STRING * 43 'DTA size needed by findfirst/next
STATIC GLPath$
DIM GLRegs AS RegTypeX

GLRegs.ds = VARSEG(GLDTa)
GLRegs.dx = VARPTR(GLDTa)
GLRegs.ax = &H1A00
CALL INTERRUPTX(&H21, GLRegs, GLRegs)

IF GLfilename$ = "" THEN
 GLRegs.ax = &H4F00
 GLRegs.cx = &H0
 CALL INTERRUPTX(&H21, GLRegs, GLRegs)
ELSE

   GLcolon = INSTR(GLfilename$, ":")
   DO
       GLslash = GLslash1
       GLslash1 = INSTR(GLslash + 1, GLfilename$, "\")
   LOOP UNTIL GLslash1 = 0
   IF GLcolon > GLslash THEN
       GLslash = GLcolon
   END IF


 GLPath$ = MID$(GLfilename$, 1, GLslash)
 GLfilename$ = GLfilename$ + CHR$(0)
 GLRegs.ds = VARSEG(GLfilename$)
 GLRegs.dx = SADD(GLfilename$)
 GLRegs.ax = &H4E00
 GLRegs.cx = &H0
 CALL INTERRUPTX(&H21, GLRegs, GLRegs)

END IF

IF (GLRegs.flags AND 1) THEN  'CF is set
 GLFlag = GLRegs.ax
ELSE
 GLFlag = 0
 GLFilename2$ = MID$(GLDTa, 31)
 GLnul = INSTR(GLFilename2$, CHR$(0))
 IF GLnul THEN
   WildCard$ = GLPath$ + LEFT$(GLFilename2$, GLnul - 1)
 END IF
END IF
END FUNCTION

CF>Second, does anyone have the hack (?) that keeps QB from
CF>dropping DTR?

To prevent CLOSE or END from lowering the DTR on comm ports,
SEEK: B0 00 E3 01 40 83 C2 04 EE
MAKE: B0 00 90 90 40 83 C2 04 EE

Be advised that if you install that last patch, you will need to drop
the DTR manually if you want it lowered.  My PBClone library can do
that for you.


(Continued in the next message)
---
 * DeLuxe* 1.26b #11507 * Two Wrongs Don't Make A Right, But Three Lefts Do.
--- FidoPCB v1.4 beta
 * Origin: CRS Online, Toronto, Ontario  (1:229/15)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET