home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk22
/
dir02
/
f000810.re_
/
f000810.re
Wrap
Text File
|
1996-04-02
|
8KB
|
228 lines
' BASIC program to output the reference file attachment information
' using the MbeRefFile object.
'
'--------------------------------------------------------------------
'
' Copyright (1995) Bentley Systems, Inc., All rights reserved.
'
' $Workfile: refinfo.bas $
' $Revision: 6.3 $
' $Date: 19 Sep 1995 09:06:30 $
'
' "MicroStation" is a registered trademark of Bentley Systems, Inc.
'
' Limited permission is hereby granted to reproduce and modify this
' copyrighted material provided that the resulting code is used only
' in conjunction with Bentley Systems products under the terms of the
' license agreement provided therein, and that this notice is retained
' in its entirety in any such reproduction or modification.
'
'--------------------------------------------------------------------
Dim active as Integer
Dim notFound as Integer
Dim display as Integer
Dim locate as Integer
Dim snap as Integer
Dim plot as Integer
Dim scaleLineStyles as Integer
Dim fileName as String
Dim logFileName as String
Dim attachName as String
Dim logical as String
Dim description as String
Dim scale as Double
Dim stat_saveSettings as Integer
'---------------------------------------------------------------
'
' getRefInfo - Copy reference file attachment information to
' global variables for processing.
'---------------------------------------------------------------
Sub getRefInfo(refFile as MbeRefFile)
Dim view as Integer
' store the current reference file information in global variables
view = 1
active = refFile.active
notFound = refFile.notFound
display = refFile.display
locate = refFile.locate
snap = refFile.snap
plot = refFile.plot
scaleLineStyles = refFile.scaleLineStyles
fileName = refFile.fileName
attachName = refFile.attachName
logical = refFile.logical
description = refFile.description
scale = refFile.scale
stat_saveSettings = refFile.saveSettings()
end Sub
'---------------------------------------------------------------
'
' printRefInfo - Output reference attachment settings to the
' file
'---------------------------------------------------------------
sub printRefInfo (iRef as Integer)
Print #2, " "
Print #2, " Settings For Reference File : ";iRef
Print #2, " =========================== : "
Print #2, " Ref File Active :";active
Print #2, " Ref File Not Found :";notFound
Print #2, " Ref File Display :";display
Print #2, " Ref File Locate :";locate
Print #2, " Ref File Snap :";snap
Print #2, " Ref File Plot :";plot
Print #2, " Ref File Scale Line Styles :";scaleLineStyles
Print #2, " Ref File Full Name :";fileName
Print #2, " Ref File Attach Name :";attachName
Print #2, " Ref File Logcal Name :";logical
Print #2, " Ref File Description :";description
Print #2, " Ref File Scale :";scale
Print #2, "Ref File Status Save Settings :";stat_saveSettings
end Sub
'---------------------------------------------------------------
'
' updateRef - Update the Reference file object with the
' changed information
'---------------------------------------------------------------
Sub updateRef (refFile as MbeRefFile, iRef as Integer)
print refFile.display
print display
if MbeRefFiles(iRef).active <> 0 then
if display <> refFile.display then
MbeRefFiles(iRef).display = display
end if
if locate <> refFile.locate then
MbeRefFiles(iRef).locate = locate
end if
if snap <> refFile.snap then
MbeRefFiles(iRef).snap = snap
end if
if plot <> refFile.plot then
MbeRefFiles(iRef).plot = plot
end if
if scaleLineStyles <> refFile.scaleLineStyles then
MbeRefFiles(iRef).scaleLineStyles = scaleLineStyles
end if
if logical <> refFile.logical then
MbeRefFiles(iRef).logical = logical
end if
if description <> refFile.description then
MbeRefFiles(iRef).description = description
end if
end if
end Sub
'---------------------------------------------------------------
'
' Main Entry point
'
'---------------------------------------------------------------
sub Main
Dim refFile as MbeRefFile
Dim iRef as Integer
Dim iRefDisplay as Integer
Dim view as Integer
Dim title as String
Dim defaultName as String
Dim logFileName as String
' if the user did not supply a file name on the command line then prompt for one
if command$ = "" then
' Ask operator for a file name
Prompt$ = " Please enter an output file name or CANCEL to use a dialog box"
' give the user a default file name
defaultName$ = "refinfo.txt"
' set the title of the input box
Title$ = "Enter Output File Name"
logFileName$ = MbeInputBox ( Prompt, defaultName, Title)
else
' use the command line input as the file name
logFileName$ = command$
end if
' If file name supplied open the file
if logFileName <> "" then
open logfileName for output access write lock write as #2
end if
' store the maximum number of reference files value
maxRefFiles = MbeRefFiles.maxRefFiles
' initialize loop counters
iRef = 1
viewTable = 1
' for each reference file do
do while iRef > 0 and iRef <= maxRefFiles
iRefDisplay = iRef
' set the refFile object variable to the current reference file object
set refFile = MbeRefFiles(iRef)
' get the information about this reference file attachment
call getRefInfo(refFile)
' if a log file was requested then output the reference attachment information to the file
if logFileName <> "" then
call printRefInfo(iRef)
end if
' if a log file was not provided then open the dialog box
if LogfileName = "" then
actionButton = mbeOpenModalDialog (1)
else
' simulate the OK button so processing continues
actionButton = 3
end if
' if OK button pressed
if actionButton = 3 then
' increment indexes in reference file object
if iRefDisplay <> iRef then
iRef = iRefDisplay
else
iRef = iRef + 1
end if
' user hit Cancel, exit the loop
elseif actionButton = 4 then
goto quitRef
' user hit apply button, update information
elseif actionButton = 1 then
call updateRef (refFile, iRef)
' user wants to see previous attachment
elseif actionButton = 1000 then
iRefDisplay = iRefDisplay - 1
iRef = iRefDisplay
end if
' do not let the reference file index below 1
if iRef < 1 then
iRef = 1
end if
Loop
' If we opened a file then close it
if logfileName <> "" then
Print #2," End Program"
close
end if
quitRef:
end Sub