« Return to Thread: Single vs Double Quotes control characters plot titles

Re: Single vs Double Quotes control characters plot titles

by Sergei Steshenko-2 :: Rate this Message:

Reply to Author | View in Thread


--- David Bateman <David.Bateman@...> 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@...
> 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/


     
_______________________________________________
Bug-octave mailing list
Bug-octave@...
https://www.cae.wisc.edu/mailman/listinfo/bug-octave

 « Return to Thread: Single vs Double Quotes control characters plot titles

LightInTheBox - Buy quality products at wholesale price