2011/6/3 Carnë Draug <carandraug+...@gmail.com>

> 2011/6/3 Philippe MALLET <philippe.mal...@cemes.fr>:
> > I looked at  zenity_list.m it didn’t work with multiple values. I was
> because
> > of the separator. I guess it was because of the backslash (maybe because
> I use
> > linux it was interpreted). So i suggest those changes:
>
> The ideia of the separator is to pick something with the lowest
> likelihood of appearing on the returned value. I also use linux and
> didn't had a problem. It's weird that it doesn't work for you. Could
> you please send the values that gave you the error?
>

 Ok. I managed to replicate this bug. It worked last year. It must had been
related with some bug in GLib since I now got the warning:
GLib-WARNING **: g_strcompress: trailing \

This will fix it
By changing this:
   options.data  = sprintf("\"%s\" ", data{:});

   ## Set separator
-  options.separator = '--separator="/\\|/\\\"';   # Will use /\|/\ as
separator
+  options.separator = '--separator="/\\\|/\\\\"';   # Will use /\|/\ as
separator

   pre_cmd = sprintf("%s ", ...
                     options.title, ...

Thank you for pointing this out. I just commited a bug fix for this.


> > But it would be easier to use the strsplit function.
>
> Using strsplit is great. I didn't knew of this function, just tried
> and works great. Will apply this change immediately. Thank you
>
> Actually, looking at it better I can't use strsplit. It can't be used to
split a string based on another string. The 'separator' give for it is a
list of separators, and splits the string if any of those characters is
found. For example:
> a = 'word1|word2'
> strsplit (a, '/\|/\',true)
ans =

{
  [1,1] = word1
  [1,2] = word2
}
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to