LineType macro crash

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
James Gran
Posts: 7
Joined: Mon Jul 11, 2011 12:43 pm

LineType macro crash

Post by James Gran »

This macro crashes on LineType[n,1] when the graph has fewer than n lines. Color[n, x,x,x] keeps going without crash. Suggestion?

' Postpone redrawing until done
'
PostponeRedraw()
Color(1,255,0,0)
Color(2,255,0,0)
Color(3,0,0,255)
Color(4,0,0,255)
Color(5,0,128,0)
Color(6,0,128,0)
Color(7,255,128,0)
Color(8,255,128,0)
Color(9,128,0,0)
Color(10,128,0,0)
Color(11,128,128,255)
Color(12,128,128,255)
'Color(13,0,255,0)
'Color(14,0,255,0)
'Color(15,255,0,255)
'Color(16,255,0,255)
'Color(17,0,255,255)
'Color(18,0,255,255)
'Color(19,255,255,0)
'Color(20,255,255,0)

'set all line widths to 0.020"
LineWidth(-2,20)

'make odd numbered lines solid
'and even numbered lines dashed
LineType(1,1)
LineType(2,5)
LineType(3,1)
LineType(4,5)
LineType(5,1)
LineType(6,5)
LineType(7,1)
LineType(8,5)
LineType(9,1)
LineType(10,5)
LineType(11,1)
LineType(12,5)
'LineType(13,1)
'LineType(14,5)
'LineType(15,1)
'LineType(16,5)
'LineType(17,1)
'LineType(18,5)
'LineType(19,1)
'LineType(20,5)
'
'Now redraw the plot:
'
ViewRedraw()
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Whoa, now! I cause enough crashes without calling a legitimate error message a crash! :D

It bothers me a bit that Color and LineType aren't consistent and I'll likely change this. In the meantime you can get around the error message by setting the maximum number of curves to the largest curve index you'll use in your macro. (Double click on the Max Size area of the status bar).
Visualize Your Data
support@dplot.com
James Gran
Posts: 7
Joined: Mon Jul 11, 2011 12:43 pm

Post by James Gran »

Sorry to have overstated the severity of the problem. My work-around is to Redraw after the error message.
James Gran
Posts: 7
Joined: Mon Jul 11, 2011 12:43 pm

Post by James Gran »

2.3.1.6 fixed this problem. Thanks.
Post Reply