TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: ESTEVE VALENTI
date: 1996-04-14 18:39:00
subject: Ansi Read (2/3)

'-------------------------------------------------------------
'-----------------  PBSCR.INC  -------------------------------
'-------------------------------------------------------------
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB :scr.defseg                                          10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Define automatical the screen segment. Like DEF SEG = &Hb800 
'                                                                       
' TO PASS:  Nothing                                                     
'                                                                       
' RETURN:   Nothing                                                     
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.defseg
    def seg = scr.seg.get
end sub
function scr.get$
  local size%
    size% = scr.size%
    call scr.defseg
    scr.get$ = peek$( 0, size% )
end function
sub scr.put( mpant$ )
    call scr.defseg
    poke$ 0, mpant$
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.get.text$                                  10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return a character string with the screen text.              
'                                                                       
'                                                                       
' TO PASS:                                                              
'    posy%          ===>  First row of the screen text to get           
'    posx%          ===>  First column of the screen text to get        
'    lend%          ===>  Lenght of the text to get                     
'                                                                       
' RETURN:                                                               
'    scr.get.text$  ===>  Character string with the screen text         
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.get.text$ ( posy%, posx%, lend% )
    local text$, t$, x%
     text$ = scr.get.chrattr$(posy%, posx%, lend%)
     for x% = 1 to len(text$) step 2
        t$ = t$ + mid$(text$,x%,1)
     next x%
     scr.get.text$ = t$
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB :scr.cursor.hold                                     10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Put the screen cursor position in an array.                  
'                                                                       
' TO PASS:  Nothing                                                     
'                                                                       
' RETURN:   Nothing                                                     
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.cursor.hold
   shared scr.cur%()                ' array when hold the cursor position
   shared scr.curp%                 ' array pointer
    if scr.curp% = 0 then
       redim scr.cur%(1:15,1:2)
    end if
    incr scr.curp%
    scr.cur%( scr.curp%, 1 ) = csrlin
    scr.cur%( scr.curp%, 2 ) = pos(0)
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB :scr.cursor.rest                                     10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Get the holded screen cursor position and change it          
'                                                                       
' TO PASS:  Nothing                                                     
'                                                                       
' RETURN:   Nothing                                                     
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.cursor.rest
   shared scr.cur%()                ' array when hold the cursor position
   shared scr.curp%                 ' array pointer
   local y%, x%
    if scr.curp% > 0 then
       y% = scr.cur%(scr.curp%,1)
       x% = scr.cur%(scr.curp%,2)
       if y% > 0 and x% > 0 then
          locate y%, x%
       else
          locate 1,1
       end if
       decr scr.curp%
    else
       locate 1,1
    end if
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB :scr.mode.def                                        10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Define the screen mode                                       
'                                                                       
' TO PASS:                                                              
'    mode%          ===>  Screen mode number. See Int 10H function 00H  
'                         of ROM BIOS book.                             
'                                                                       
' RETURN:  Nothing                                                      
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.mode.def( mode% )
    reg 1, mode%
     call interrupt &h10
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.mode.get%                                  10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Get the screen mode number                                   
'                                                                       
' TO PASS:  Nothing                                                     
'                                                                       
' RETURN:                                                               
'    scr.mode.get%  ===>  Screen mode number                            
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.mode.get%
     reg 1, &h0f00
      call interrupt &h10
     scr.mode.get% = reg(1) mod 256
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.page.get%                                  10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Get the number of the active screen page.                    
'                                                                       
' TO PASS:  Nothing                                                     
'                                                                       
' RETURN:                                                               
'    scr.page%      ===> active screen page number.                     
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.page.get%
     reg 1, &h0f00
      call interrupt &h10
     scr.page.get% = reg(2) \ 256
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.rows%                                      10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return the maxium screen rows number                         
'                                                                       
' TO PASS: Nothing                                                      
'                                                                       
' RETURN:                                                               
'    scr.rows%      ===>  Returns the maxium rows number of the actual  
'                         screen: 25, 43 or 50.                         
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.rows%
    local rows%
     reg 1, &h1130                  ' func. 11h subfunc. 30h
      call interrupt &h10           ' get letter type (EGA,MCGA,VGA)
     rows% = (reg(4) mod 256) + 1   ' exxtract DL
     if rows%  0 then
        scr.rows% = rows%
     else
        scr.rows% = 25
     end if
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.cols%                                      10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return the screen columns size.                              
'                                                                       
' TO PASS: Nothing                                                      
'                                                                       
' RETURN:                                                               
'    scr.cols%      ===>  Returns the maxium columns number of the      
'                         actual screen: 40, 80, 132.                   
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.cols%
    local columns%
     reg 1, &h0f00
      call interrupt &h10
     columns% = reg(1) \ 256
     scr.cols% = columns%
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.size%                                      10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return the size in bytes of the screen memory                
'                                                                       
' TO PASS:  Nothing                                                     
'                                                                       
' RETURN:                                                               
'    scr.size%      ===>  size in bytes of the screen. (rows*cols*2)    
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.size%
   local size%
     size% = scr.rows% * scr.cols% * 2
     size% = size%
     scr.size% = size%
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB :scr.text.8x8                                        10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Change the screen type to 8x8 character's size.              
'                                                                       
' TO PASS: Nothing                                                      
'                                                                       
' RETURN:  Nothing                                                      
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.text.8x8
    reg 1, &h1112
    reg 2, 0
     call interrupt &h10
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB :scr.text.8x14                                       10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Change the screen type to 8x14 character's size.             
'                                                                       
' TO PASS: Nothing                                                      
'                                                                       
' RETURN:  Nothing                                                      
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.text.8x14
    reg 1, &h1111
    reg 2, 0
     call interrupt &h10
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB :scr.text.8x16                                       10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Change the screen type to 8x16 character's size.             
'                                                                       
' TO PASS: Nothing                                                      
'                                                                       
' RETURN:  Nothing                                                      
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.text.8x16
    reg 1, &h1114
    reg 2, 0
     call interrupt &h10
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.seg.get                                    10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return the screen segment number. Detect all type of graphic 
'          tarjets ( Hercules, CGA, EGA, VGA, SVGA, etc... ) and return 
'          his correspondents screen segment numbers.                   
'                                                                       
' TO PASS:  Nothing                                                     
'                                                                       
' RETURN:                                                               
'    scr.seg.get    ===>  Screen segment number.                        
'                         Hercules = &hb000                             
'                         CGA      = &hb800 if it's the first page      
'                         EGA, VGA = &ha000                             
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.seg.get
    local ah%, al%, bh%
    local s%, o%, w%
     reg (1), &hf * 256             ' function "Search video mode"
      call interrupt &h10           ' of the ROM BIOS
     ah% = reg(1) \ 256
     al% = reg(1) mod 256
     bh% = reg(2) \ 256
     w% = bh%                       ' actived screen page
     if ah% = 80 then               ' screen page size
        o% = &h100
     else
        o% = &h80
     end if
     select case al%                ' video mode
      case &h0 to &h6               ' text or medium resolution graphics
        s% = &hb800
      case &h7                      ' hercules monochrome
        s% = &hb000
      case &h8 to &ha               ' PCjr exclusive video mode
        s% = &hb800
      case &hd to &h13              ' high resolution graphics
        s% = &ha000
      case else
        s% = &hb800
     end select
     scr.seg.get = s% + (o% * w%)
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.get.chrattr$                               10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return a character string with a selected part of the        
'          screen memory.                                               
' TO PASS:                                                              
'    posy%          ===>  First row of the screen text|attr to get      
'    posx%          ===>  First column of the screen text to get        
'    lend%          ===>  Lenght of the text to get                     
'                                                                       
' RETURN:                                                               
'    scr.get.chrattr===>  Character string = "CACACACACACA"             
'                                             C = screen character      
'                                             A = color attribute of    
'                                                 previus character     
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.get.chrattr$( posy%, posx%, lend% )
    local o%, text$
     call scr.defseg                ' automaticall DEF SEG =
     o% = scr.pos2offset%( posy%, posx% )
     text$ = peek$( o%, lend% * 2)  ' get into the screen memory a string
     scr.get.chrattr$ = text$
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB:scr.put.chrattr$                                     10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Put a character string in the selected part of the           
'          screen memory.                                               
' TO PASS:                                                              
'    posy%          ===>  First row of the screen text|attr to get      
'    posx%          ===>  First column of the screen text to get        
'    scr.part$      ===>  Character string = "CACACACACACA"             
'                                                                       
' RETURN:                                                               
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.put.chrattr( posy%, posx%, scr.part$ )
   local o%
    call scr.defseg
    o% = scr.pos2offset( posy%, posx% )
    poke$ o%, scr.part$
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.pos2offset%                                10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Translate a BASIC screen position to the correspondent       
'          screen memory offset                                         
'                                                                       
' TO PASS:                                                              
'    posy%          ===>  Row      Y screen position                    
'    posx%          ===>  Column   X screen position                    
'                                                                       
' RETURN:                                                               
'    scr.pos2offset%===>  Screen memory offset                          
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.pos2offset%( posy%, posx% )
    local o%
     o% = scr.cols% * 2 * (posy% - 1) + 2 * (posx% - 1)
     scr.pos2offset% = o%
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.color2attr%                                10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return the color attribute number of the Fore Ground and     
'          Back Ground color passed.                                    
'                                                                       
' TO PASS:                                                              
'    fgc%           ===>  Fore Ground color                             
'    bgc%           ===>  Back Ground color                             
'                                                                       
' RETURN:                                                               
'    scr.color2attr===>  Colour attribute                               
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.color2attr%( fgc%, bgc% )
    local temp%
     temp% = (bgc% * 16) + fgc%
     if fgc% > 15 then temp% = temp% + 112
     scr.color2attr% = temp%
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' SUB :scr.attr2color.fn                                  10-19-1992    
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return the Fore Ground and Back Ground colors of the passed  
'          color attribute.                                             
'                                                                       
' TO PASS:                                                              
'    attr%          ===>  Colour attribute value.                       
'                                                                       
' RETURN:                                                               
'    fgc%           ===>  Fore Ground Colour extracted of color attrib. 
'    bgc%           ===>  Back Ground Colour    "            "          
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
sub scr.attr2color.fn( attr%, fgc%, bgc% )
    fgc% = attr% mod 8
    if (attr% and 8)    0 then fgc% = fgc% + 8      ' intensity
    if (attr% and 128)  0 then fgc% = fgc% + 16     ' blink
    bgc% = ( attr% \ 16 ) mod 8
end sub
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.attr2fgc%                                  10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return the Fore Ground Colour of the passed attribute.       
'                                                                       
' TO PASS:                                                              
'    attr%          ===>  Colour attribute value.                       
'                                                                       
' RETURN:                                                               
'    scr.attr2fgc%  ===>  Fore ground color value extracted of attrib.  
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.attr2fgc%( attr% )
    local mfgc%, mbgc%
     call scr.attr2color.fn( attr%, mfgc%, mbgc% )
     scr.attr2fgc% = mfgc%
end function
'
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' FUNCTION :scr.attr2bgc%                                  10-19-1992   
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
' ACTION:  Return the Back Ground Colour of the passed attribute.       
'                                                                       
' TO PASS:                                                              
'    attr%          ===>  Colour attribute value.                       
'                                                                       
' RETURN:                                                               
'    scr.attr2bgc%  ===>  Back ground color value extracted of attrib.  
'                                                                       
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
function scr.attr2bgc%( attr% )
    local mfgc%, mbgc%
3垳茴x4
ィ	畛
j-=mld\c胄Qkkbal0eN
b鴉l{藻W沌eP薹蠍|骨bI-|eL奠XaMQ:t
治0市AミJ=m佃嶝jiCn4Fg亳`s-D3_L
|
jm
Zjz	'
}D靤hi]Wbgeq6lknv奩+ZzJgo濆鐓C招ー`茖嶽~僉賃
8R鰡Og姿gW痔?K6H+
L
J6`zA衷`Ugn1yiFa---------------

FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC   Ref: D4N00002 Date: 04/14/96
From: ESTEVE VALENTI                                        Time: 06:41pm
\/To: ALL                                                 (Read 3 times)
Subj: Ansi Read (3/3)

'--------------------------------------------------------------
'-------------------   PBDSK.INC  -----------------------------
'--------------------------------------------------------------
'浜様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
様
'  Subrrutina ....: FindFile                                              
  
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
様
'  Busca un fichero o grupo de ficheros en la trayectoria especificada en 
  
'  Search$.  ej:  Search$ = A:\*.*  = el primer fichero de A:\*.*         
  
'                     la siguiente llamada se hace con Search$ = ""       
  
'                 Search$ =   ""    = el segundo fichero de A:\*.*        
  
'麺様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
様
'   search$  ====>  Trayectoria de busqueda y fichero si procede.         
  
'   sattrib% ====>  Atributo del fichero a buscar.  ej:  0 = Fichero 
Normal 
'                                                                         
  
'   Retorna...:                                                           
  
'      f$       ===> Nombre y tipo de fichero                             
  
'      fattrib% ===> Atributo del fichero                                 
  
'      size&    ===> Longitud del fichero en bytes.                       
  
'      date%    ===> Byte de Fecha de grabacin del fichero.              
  
'      time%    ===> Byte de Hora,Minuto,Segundo de grabacin del fichero. 
 
'      e%       ===> Codigo de error. 0=No error   2=Path no valido       
  
'                                    18=No hay mas ficheros               
  
'藩様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様様
様
SUB FindFile(search$,sattrib%,f$,fattrib%,size&,date%,time%,e%)	PUBLIC
   STATIC dta%()  			' static disk transfer area
   DIM dta%(0:31)                    ' 64 bytes - preserved between calls
   LOCAL dtas#, dtao#
   STATIC buf$                       ' note: this must be a static variable
    dtas# = VARSEG(dta%(0))
    dtao# = VARPTR(dta%(0))
    REG 1,&h1A00                    	' DOS set DTA address function
    REG 8,dtas#		            	' DS:DX = address of buffer
    REG 4,dtao#
     CALL INTERRUPT &H21
    IF search$"" THEN               'prepare for find first call
       buf$ = search$+chr$(0)         ' create a buffer to hold search 
string
       DEF SEG                        ' set default data segment
       REG 1,&h4E00                 	' DOS find first function
       REG 3,sattrib%               	' search attribute byte in CL
       REG 8,STRSEG(buf$)            	' DS:DX = pointer to buffer
       REG 4,STRPTR(buf$)
    ELSE                              'prepare for find next call
       REG 1,&h4F00                 	' DOS find next function
    END IF
     CALL INTERRUPT &H21
    e% = REG(1)                     	' get error from AX
    IF e%=0 THEN                      	'ok, so extract file info
       DEF SEG = dtas#
       f$ = PEEK$(dtao#+30,13)                ' extract file
       f$ = LEFT$(f$,INSTR(f$,CHR$(0))-1)	'  extract CHR$(0) of file
       fattrib% = dta%(10) \ 256              ' extract file attribute
       size& = CLNG( PEEKL(dtao+26) )	' extract file size
       date% = dta%(12)			' extract file date
       time% = dta%(11)			' extract file time
       DEF SEG
    END IF
END SUB
 * Wave Rider 1.20 [NR] *
... UNREGISTERED EVALUATION COPY
--- Wave Rider v1.20
(757:101/24)
---------------
* Origin: Clot BBS 34-3-2324070 (A 14K4) / 34-3-2654579 (A 28K8)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.