summaryrefslogtreecommitdiff
path: root/Windows/spice/share/ngspice/scripts/setplot
blob: 38ca0da152b11aeac3c6ee95aba38f3fe214dcf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
* set the current working plot
.control

begin
	unset resp
	if $argc
		set resp = $argv[1]
	else
		if $?plots = 0
			echo Error: there aren\'t any plots currently loaded.
			goto bottom
		else
			if $#plots = 0
				echo Error: there aren\'t any plots currently loaded.
				goto bottom
			end
		end

		if $?resp = 0
			set oldplot = $curplot
			echo '	Type the name of the desired plot:'
			echo ''
			echo '	new	New plot'
			foreach pl $plots
				set curplot = $pl
				strcmp i $pl $oldplot
				if $i = 0
					echo "Current $pl	$curplottitle ({$curplotname})"
				else
					echo "	$pl	$curplottitle ({$curplotname})"
				end
			end
			set curplot = $oldplot
			echo -n '? '
			set resp = $<
		end
	end


	strcmp i $resp ""
	if $i = 0
		goto bottom
	end

	strcmp i $resp new
	if $i = 0
		set curplot = new
		goto bottom
	end

	foreach pl $plots
		strcmp i $resp $pl
		if $i = 0
			set curplot = $pl
			goto bottom
		end
	end

	echo Error: no such plot name $resp

	label bottom

	unset resp i pl newflag oldplot
end