	character*5 Input
	character*10 InFile, OutFile
	integer*2 Error, KeyBoard, Display, I, Last

c	Functions
c	---------

	integer*2 SysLun, Length

	call TTYinit

	call ClrScr

	KeyBoard = SysLun( 'KeyBoard' )
	Display  = SysLun( 'Display' )

	call GetFileName( Input, 20, Error )

	if( Error .eq. 0 ) then
	  if( Input .eq. '/NOS' ) stop '[No source generated]'
	end if

	if( Error .ne. 0 ) then
	  call DsplyVersion
          call OutString('File name: ')
	  read(KeyBoard,20) Input
20	  format(a)
	end if

	Last = 0
	do 25 I = 1 , Length(Input)
	  if( Input(I:I) .eq. '.' ) goto 26
	  Last = I
25	continue
26	continue

	if( Last .gt. 5 ) Last = 5
	InFile = Input(1:Last) // '.scr'
	OutFile = Input(1:Last) // '.for'

	call GenScr( InFile, OutFile )

	write(Display,100)
100	format(1x,' ')

	stop '[End of BldScr]'

	end


	subroutine DsplyVersion

	character*6 Version
	character*2 CrLf
	integer*2 L1

c--
c functions

	integer*2 Length


	CrLf(1:1) = char(13)
	CrLf(2:2) = char(10)

	call GetVersion( Version )
	L1 = Length( Version )
	if( L1 .eq. 0 ) L1 = 1
	call OutString( '[BldScr - version ' )
	call OutString( Version(1:L1) )
	call OutString( ']' )
	call OutString( CrLf )

	end
