home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 12
/
CD_ASCQ_12_0294.iso
/
vrac
/
qwsample.zip
/
TXT2PHN.SCR
< prev
Wrap
Text File
|
1994-01-11
|
2KB
|
62 lines
' This script will prompt for a text file to import into the current phone
' book. The default column positions are appropriate for MSI's WCLIST.TXT
' listing of Wildcat! BBS systems. The numbers will have to be changed for
' other BBS listings.
dialog FilenameDialog 100, 100, 200, 130
caption "Import text file to phonebook"
groupbox "", -1, 5, 5, 190, 91
ltext "Input file", -1, 10, 16, 40, 12
InputFile as edittext 101, 50, 15, 130, 12
pushbutton "&View file...", 110, 90, 30, 50, 14
ltext "System name start column", -1, 10, 56, 90, 12
SystemStart as edittext 102, 110, 55, 20, 12
ltext "length", -1, 140, 56, 20, 12
SystemLength as edittext 103, 170, 55, 20, 12
ltext "Phone number start column", -1, 10, 76, 90, 12
NumberStart as edittext 104, 110, 75, 20, 12
ltext "length", -1, 140, 76, 20, 12
NumberLength as edittext 105, 170, 75, 20, 12
defpushbutton "OK", IDOK, 40, 105, 50, 14
pushbutton "Cancel", IDCANCEL, 110, 105, 50, 14
end dialog
function FilenameDialog.id(110) as integer
viewfile InputFile
end function
dim fd as FilenameDialog
dim sstart as integer
dim slength as integer
dim nstart as integer
dim nlength as integer
dim entry as PhoneEntry
fd.SystemStart = "15"
fd.SystemLength = "25"
fd.NumberStart = "1"
fd.NumberLength = "12"
if dialogbox(fd) = IDCANCEL then end
sstart = val(fd.SystemStart)
slength = val(fd.SystemLength)
nstart = val(fd.NumberStart)
nlength = val(fd.NumberLength)
open fd.InputFile for input as #1
print "Importing...";
do while not eof(1)
dim s as string
input #1, s
entry.systemname = rtrim(mid(s, sstart, slength))
entry.number(1) = rtrim(mid(s, nstart, nlength))
entry.Emulation = ANSI
entry.Protocol = Zmodem
addentry entry
print ".";
loop
print
close #1
catch err_fileopen
MsgBox "Unable to open file "+fd.InputFile