home *** CD-ROM | disk | FTP | other *** search
- procedure hdPrint ;
- begin
- MessageBox ( ^C'Not available in Special Edition' ,
- NIL ,
- mfInformation + mfOKButton ) ;
- end ;
- {|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-
- OPEN
-
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||}
- {===================================================================
-
- OPEN - from DOS params (wildcards OK)
-
- ===================================================================}
- procedure CommandLineOpen ;
- var
- x ,
- LoadCount : byte ;
- {-------------------------------------------------------------------
- Handle Wildcards
- -------------------------------------------------------------------}
- function OpenWildCard ( S : string ) : boolean ;
- var
- SR : SearchRec ;
- D : DirStr ;
- N : NameStr ;
- E : ExtStr ;
- begin
- OpenWildCard := FALSE ;
- S := FExpand ( S ) ;
- FSplit ( S , D , N , E ) ;
- if D [ length ( D ) ] <> '\' then
- D := D + '\' ;
- FindFirst ( S , AnyFile , SR ) ;
- while DosError = 0 do
- begin
- if ( SR.Attr and Directory = 0 ) and
- ( SR.Attr and Hidden = 0 ) and
- ( SR.Attr and SysFile = 0 ) and
- ( SR.Attr and VolumeID = 0 ) and
- ( SR.Name <> '.' ) and
- ( SR.Name <> '..' ) and
- {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- COM, EXE, OVERLAY
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
- ( pos ( '.BIN' , SR.Name ) = 0 ) and
- ( pos ( '.COM' , SR.Name ) = 0 ) and
- ( pos ( '.EXE' , SR.Name ) = 0 ) and
- ( pos ( '.HLP' , SR.Name ) = 0 ) and
- ( pos ( '.OBJ' , SR.Name ) = 0 ) and
- ( pos ( '.OVL' , SR.Name ) = 0 ) and
- ( pos ( '.OVR' , SR.Name ) = 0 ) and
- ( pos ( '.TPU' , SR.Name ) = 0 ) and
- ( pos ( '.VRM' , SR.Name ) = 0 ) and
- {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- COMPRESSED
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
- ( pos ( '.ARC' , SR.Name ) = 0 ) and
- ( pos ( '.ZIP' , SR.Name ) = 0 ) and
- ( pos ( '.LZH' , SR.Name ) = 0 ) then
- begin
- OpenEditor ( D + SR.Name , TRUE ) ;
- inc ( LoadCount ) ;
- end ;
- {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- LIMIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
- if LoadCount >= 16 then
- begin
- MessageBox ( 'Cannot auto-load more than 16 files' ,
- NIL ,
- mfInformation + mfOKbutton ) ;
- EXIT ;
- end ;
- FindNext ( SR ) ;
- end ;
- OpenWildCard := TRUE ;
- end ;
- {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- PROCESS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
- begin
- LoadCount := 0 ;
- {- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- MULTI-LOAD "*" or '?', OTHERWISE LOAD AS FILE
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
- for x := 1 to WordCount ( ParameterString ) do
- begin
- if LoadCount < 16 then
- begin
- if ( pos ( '*' , Pluck ( ParameterString , x ) ) <> 0 ) or
- ( pos ( '?' , Pluck ( ParameterString , x ) ) <> 0 ) then
- begin
- if not OpenWildCard ( Pluck ( ParameterString , x ) ) then EXIT ;
- end
- else
- begin
- OpenEditor ( Pluck ( ParameterString , x ) , TRUE ) ;
- inc ( LoadCount ) ;
- end ;
- end ;
- end ;
- end ;
-