home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Buyer 1998 February
/
DPCB0298.iso
/
DTP
/
TurboCad
/
TCW.Z
/
colors.bas
< prev
next >
Wrap
BASIC Source File
|
1997-05-05
|
792b
|
37 lines
'Script that will select by color and then save selection as new file
Global Const NULL = 0
Sub Main()
Dim hDrawing As Long
Dim g As Long
Dim Result As Long
hDrawing = TCWDrawingActive()
if hDrawing = NULL then
MsgBox "Must have an active drawing"
Stop
end if
g = TCWSelectByQuery("Color = Red")
if g <> NULL then
Result = TCWDrawingSaveAs("Red.tcw", True)
end if
g = TCWSelectByQuery("Color=Blue")
if g <> NULL then
Result = TCWDrawingSaveAs("Blue.tcw", True)
end if
Dim clr as string
'Dark Green needs to be quoted, so we have to build our
'query string Color = "Dark Green"
clr = "Color = " & chr(34) & "Dark Green" & chr(34)
g = TCWSelectByQuery(clr)
if g <> NULL then
Result = TCWDrawingSaveAs("Green.tcw", True)
end if
End Sub