Single vs Double Quotes control characters plot titles

David Bateman David.Bateman at motorola.com
Wed May 14 03:05:13 CDT 2008


gOS wrote:
> gOS wrote:
>   
>> I know GNU plot is being phased out, but I think this goes a bit deeper
>> than GNU plot. Run both of these without jhandles and pay attention to the
>> title:
>>
>>     
>
> I guess more to the point, since it seems you have just accepted the 'bug'
> upon further inspection of the documentation, how do I detect the difference
> between a single quote string and a double quote string?
>   
There is no question of having the "bug accepted". As Etienne stated
this is not a bug, but the correct interpretation of escaped characters
in double quoted strings.. If you want compatible behavior with Matlab
then always use single quoted strings. As for telling if a string is
single or double quoted, the following works

octave:1> a = 'single';
octave:2> b = "double";
octave:3> typeinfo (a)
ans = sq_string
octave:4> typeinfo (b)
ans = string

or as a test

if (strcmp (typeinfo(str), "single"))
  ## Have single quoted string
else
  ## Have double quoted string
endif

D.

-- 
David Bateman                                David.Bateman at motorola.com
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



More information about the Bug-octave mailing list