|
From: atoms.h <sto...@gm...> - 2010-02-04 13:15:18
|
Thanks a million!
Thomas Sefzick wrote:
>
> "==" and "!=" work for numerical values not for strings.
> instead use the 'strstrt()' function:
> if (strstrt("horizontal",cut_style)!=0) ...
>
>
> atoms.h wrote:
>>
>> Hi there,
>>
>> i'm using a script where i have some possibilities of changing the style
>> of plotting by call parameters. However, for some reason one of them
>> doesn't work.
>>
>> First up here's what DOES work:
>> I call the script like this
>> $ call 'scale_new.gp' "horizontal"
>>
>> whithin i define:
>>
>> cut_style="$0"
>>
>> single_1=top_level.sub_level."/pzr_cuts".which_cut.cut_style."_cut/cut1/"
>> if(cut_style=="horizontal" && cut_style!="radial") set xrange
>> [-1.5:1.5]; set xtics -1.5,0.5; set yrange [0:*]
>> if(cut_style=="radial" && cut_style!="horizontal") set xrange [0:180];
>> set xtics 0,15; set yrange [0:*]
>>
>> (it does NOT work with an if else statement!)
>>
>> Now what doesn't work is the following:
>> $ call 'scale_new.gp' "horizontal" "print"
>>
>> i've defined:
>>
>> plt_style="$1"
>> if(plt_style=="print" && plt_style!="plot") set term postscript
>> landscape enhanced color 16; set output
>> top_level.sub_level."/pzr_cuts".which_cut.cut_style."20100402.ps"
>> if("$1"=="plot" && plt_style!="print" ) set term wxt enhanced
>>
>> As a remark i should say that i'm using this strange if and if not
>> statement because it doesn't work at all if i don't.
>> After all i come to suspect that either there is something fishy whith
>> the if statement or i simply don't understand it properly.
>> In either way help is appreciated!
>>
>> Thomas
>>
>
>
--
View this message in context: http://old.nabble.com/problem-with-%27if%27-tp27449730p27452176.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|