Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Problems using a loop statement
Pages: [1] Print
Author Topic: Problems using a loop statement  (Read 256 times)
jmcnealy
Newbie
*
Offline Offline

Posts: 7


View Profile
Problems using a loop statement
« on: May 22, 2005, 03:37:04 PM »

Hello everybody,

I have what I hope is a short quick problem. I have the following script:

loop 5 [append a b c: read a append e c b: b + 10]

where a: is the url http://news.google.com/news?hl=en&ned=us&q...F-8&sa=N&start=

b: is 0

c: is ""

d: is also http://news.google.com/news?hl=en&ned=us&q...F-8&sa=N&start=

and e: is ""

The idea is to recursively pull the search for the term "pope" from the Google news site. To do this I must increment b by 10 each time. The script works almost perfectly. The only problem is that when b is appended to a, it stacks on to the back of a like so:

http://news.google.com/news?hl=en&ned=us&q...start=010203040

What I want is "0, 10, 20, 30, 40" like so added to a. Now I have used that following trick to set a back to the first url setting:

loop 5 [append a b c: read a append e c b: b + 10 a: d]

However, something weird happens: d is somehow set to the value of a:

http://news.google.com/news?hl=en&ned=us&q...start=010203040

Why does d become a? Shouldn't it be the other way around? Does anyone have any ideas on how I can reset a: to the url search term? The scripts seems to work great other wise. Thanks for your help.
Logged
Gabriele
Full Member
***
Offline Offline

Posts: 182


View Profile WWW
Problems using a loop statement
« Reply #1 on: May 23, 2005, 04:28:04 AM »

APPEND changes the url in place.

Try: d: append copy a b
or: d: join a b

BTW, I'd suggest you using better names than a, b, c... Smiley
Logged
jmcnealy
Newbie
*
Offline Offline

Posts: 7


View Profile
Problems using a loop statement
« Reply #2 on: May 23, 2005, 08:08:32 AM »

Thank you very much Gabriele for your help. The "d: append ab" worked perfectly. Just what I needed. Btw, the variable names are just for testing until I get the script working the way I want. Thanks again.
« Last Edit: May 23, 2005, 08:11:48 AM by jmcnealy » Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Problems using a loop statement
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2008, 12:17:24 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2287 Posts in 593 Topics by 3733 Members
Latest Member: Daeujic

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc