I am trying to add an arbitrary number of reference lines into a graph based on the arguments given in a function. And I can construct the string I need without too much trouble. The issue I'm having is that I can't seem to get it into past parse() due to the commas in the string. All I really want to do is peel off the outer quotes from the string and substitute it into and remove the \!'s if necessary. Perhaps there's a much better way to do this but here's the guts of my attempt:
Expression that needs adjustment:
FixyAxis = expr( gbt <<
SendToReport(
Dispatch(
{},
"Graph Builder",
OutlineBox,
{myTitle}
),
Dispatch(
{},
name,
ScaleBox,
{
Min( minY ), Max( maxY ), Inc( ticksY ),
IntRefLines,
Show Major Grid( 1 ), , Show Minor Grid( 1 )
}
)
)
) ;
String variable I'm trying to substitute with (cr added for readability):
myRefLines = "Add Ref Line(60, Solid, \!"Medium Dark Red\!",\!"USL_lt_2.5\!", 2 ),
Add Ref Line(30, Solid, \!"Medium Dark Red\!",\!"USL_gt_2.5_lt_4.5\!", 2 ),"
But parse() hits the first comma and quits:
substitute into(fixYaxis, Expr(IntRefLines), parse(myRefLines)) ;
Unexpected ",". Perhaps there is a missing ";" or ",".
Line 1 Column 60: ...rk Red","USL_lt_2.5", 2 )►,Add Ref Line(30, Solid, ...
In the end what I want fixYaxis to look like is:
FixyAxis = expr( gbt <<
SendToReport(
Dispatch(
{},
"Graph Builder",
OutlineBox,
{myTitle}
),
Dispatch(
{},
//"Mean",
name,
ScaleBox,
{
Min( minY ), Max( maxY ), Inc( ticksY ),
Add Ref Line(60, Solid, "Medium Dark Red","USL_lt_2.5", 2 ),
Add Ref Line(30, Solid, "Medium Dark Red","USL_gt_2.5_lt_4.5", 2 ),
Show Major Grid( 1 ), , Show Minor Grid( 1 )
}
)
)
) ;
Thanks for any help!
Phil