Single vs Double Quotes control characters plot titles

Sergei Steshenko sergstesh at yahoo.com
Wed May 14 03:19:52 CDT 2008


--- David Bateman <David.Bateman at motorola.com> wrote:

> 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) 
> 

Did you actually mean

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

?

Thanks,
  Sergei.



Applications From Scratch: http://appsfromscratch.berlios.de/


      


More information about the Bug-octave mailing list