Blame demo/macros.dem

Packit 0986c0
#
Packit 0986c0
# Exercise use of macro substitution
Packit 0986c0
#
Packit 0986c0
set macros
Packit 0986c0
Packit 0986c0
title = "Test of command line macro substitution"
Packit 0986c0
style1 = "points"
Packit 0986c0
style2 = "lines lw 2"
Packit 0986c0
plot1 = "'1.dat' using 1:2 with @style1"
Packit 0986c0
plot2 = "'1.dat' using 1:($2+1) with @style2"
Packit 0986c0
plot3 = '@plot2'
Packit 0986c0
plot4 = '@plot3'
Packit 0986c0
plot5 = '@plot4'
Packit 0986c0
plot6 = '@plot5'
Packit 0986c0
#
Packit 0986c0
set title title
Packit 0986c0
plot @plot1 title 'plot1', \
Packit 0986c0
     @plot2 title 'plot2'
Packit 0986c0
show var
Packit 0986c0
#
Packit 0986c0
pause -1 "<cr> to test limit on recursion depth"
Packit 0986c0
#
Packit 0986c0
print "testing depth 3"
Packit 0986c0
plot @plot1 title 'plot1', @plot3 lt 3 title 'Recursion depth 3'
Packit 0986c0
pause 1
Packit 0986c0
print "testing depth 4"
Packit 0986c0
plot @plot1 title 'plot1', @plot4 lt 4 title 'Recursion depth 4'
Packit 0986c0
pause 1
Packit 0986c0
print "testing depth 5"
Packit 0986c0
plot @plot1 title 'plot1', @plot5 lt 5 title 'Recursion depth 5'
Packit 0986c0
pause 1
Packit 0986c0
#
Packit 0986c0
pause -1
Packit 0986c0