Runrev bug, or I have made an error ?
Björnke von Gierke
bvg at mac.com
Thu Jun 30 09:09:45 EDT 2005
Hi Damien
First, try to not name anything with a number, especially stacks, but
also variables.
Second: Its not good to modify the variable you use in a "repeat for
each" loop (in this case "TheList")
Third: If you want to add one line to a variable it is faster to say
"add one to x" then "put x + 1 into x"
I suggest you try this script instead:
put fontnames() into TheList
sort TheList
repeat for each line x in TheList
put tab & x & return after theResult
end repeat
put char 1 to -1 of theResult into theResult --to delete the last
return
greetings
Björnke
On Jun 30 2005, at 14:53, Damien Girard wrote:
> Hi all,
>
> I am using runrev 2.6 under linux, and I have a strange bug.
>
> I need to get a list of font, and put a tab before each line of the
> fontlist
> (is it for a font menu).
>
> This is my script :
>
> put fontnames() into TheList
> sort TheList
>
> put "0" into LineToDo
> repeat for each line 1 in TheList
> put LineToDo +1 into LineToDo
> put tab before line LineToDo of TheList
> end repeat
>
> And the problem is in the result :
>
> -------- The Result
>
> andale sans
> andy mt
> bell mt
> bitstream charter
> bitstream vera sans
> bitstream vera sans mono
> bitstream vera serif
> century schoolbook l
> charter
> clean
> courier
> courier 10 pitch
> cumberland amt
> fixed
> helvetica
> lucida
> lucidabright
> lucidatypewriter
> luxi mono
> luxi sans
> luxi serif
> monotype sorts
> new century schoolbook
> nimbus mono l
> nimbus roman no9 l
> nimbus sans l
> segoe
> suse sans
> suse sans mono
> suse serif
> tahoma
> terminal
> thorndale amt
> times
> urw bookman l
> urw chancery l
> urw gothic l
> urw palladio l
> utopia
>
> -------- /The Result
>
> The problem, is that all font have got a tab before it, but not 2 last
> line :
> urw palladio l
> utopia
>
> For me, I didn't see any bug in the script, but this seem to doesn't
> work...
>
> Thanks.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
--
http://contest.wecode.org
Now running: the first ChatRev coding contest!
sponsors:
Altuit
Andre Garzia
Fourth World
Karl Becker
Runtime Revolution
TidBITS in cooperation with eHUG
More information about the use-livecode
mailing list