Search the web
Sign In
New User? Sign Up
OSCAR-PROJECT · OSCAR is an open source REBOL interpreter
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: [OSCAR Project] Revised -Rebol Coded/ Diagram   Message List  
Reply | Forward Message #1004 of 1031 |
Re: Revised -Rebol Coded/ Diagram

--- In OSCAR-PROJECT@y..., "Andrew Martin" <Al.Bri@x> wrote:
> marrowmilo wrote:
> > Revised -Rebol Coded/ Diagram
> >
> > |
> > | foreach
> > | example
> > | colors ->
> > | | [if parse
> > | | example
> > | | [to "pink"
> > | | to end]->
> > | | -
> > | | print
> > | | example]]
> > | | ->
>
> That seems awfully time consuming. What's wrong with simply writing:
>
> foreach Color Colors [
> if parse Color [
> to "pink" to end
> ][
> print Color
> ]
> ]
> ?
>
> Note that I've Title-Cased the important words; changed
your 'example to
> 'Color to better reflect the Many contents of 'Colors and the
single nature
> of 'Color; and used consistent indenting.
>
> I hope that helps!
>
> Andrew Martin
> ICQ: 26227169 http://valley.150m.com/
> -><-


------------------------------------------------
H O W T H E R E B O L S C R I P T W O R K S ?
==================================================
Andrew : Thank you for your reply am now trying pseudcode
to get some understanding of how the script works.
Suggestions would be most welcome from you
and fellow subscribers.
- - - - - - - - - - - - - - - - - -
-----------------------------------------------------
P O S S I B L E P S E U D O C O D E
======================================
{ loop | foreach color in colors }
if [ not end color | true ]
if [color contains " pink" | true ]
print color
{ go to loop }

--------------------------------------------------------
R E B O L
=========
colors: ["sun is red" "a pink rose" "gold coin" "a pink elephant"]
foreach color colors [
if parse color [ to "pink" to end]
[print color]]
------------------------------------------------
>> colors: ["sun is red" "a pink rose" "gold coin" "a pink elephant"]
== ["sun is red" "a pink rose" "gold coin" "a pink elephant"]
>> foreach color colors [
[ if parse color [ to "pink" to end]
[ [print color]]
a pink rose
a pink elephant
>>
-------------------------------------------------
foreach Color Colors [
if parse Color [
to "pink" to end
][
print Color
]
]
------------------------------------------------
H O W T H E R E B O L S C R I P T W O R K S ?
==================================================
s o m e
a l t e r n a t i v e s
p o s s i b i l i t i e s
c h o i c e s
================================================


"a pink rose"

"pink" length (6 less 2)


" start 2nd pass

a - p i false

- p i n false

p i n k true

i n k -

n k - r

k - r o

- r o s

r o s e

" end 2nd pass


---------------------------------------------------------
ANY SUGGESTIONS MOST WELCOME

TONY MARROW

















Sun Nov 11, 2001 8:40 pm

niemteltm
Offline Offline
Send Email Send Email

Forward
Message #1004 of 1031 |
Expand Messages Author Sort by Date

... That seems awfully time consuming. What's wrong with simply writing: foreach Color Colors [ if parse Color [ to "pink" to end ][ print Color ] ] ? Note...
Andrew Martin
taorebol
Offline Send Email
Nov 11, 2001
12:10 am

... your 'example to ... single nature ... H O W T H E R E B O L S C R I P T W O R K S ? ================================================== Andrew :...
marrowmilo@...
niemteltm
Offline Send Email
Nov 11, 2001
8:40 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help