Hey, I tried like twelve variations of this and still get weird results. Can
anyone tell me what I am doing wrong, and why the output seems to defy reason?
What I had in mind was a function that took as it's parameters some text to
enclose within tags, and the information needed to build a tag around the text.
The sample list tries to supply all of the information needed to create a valid
HTML "anchor" tag.

Now, I realize that the end tag does not have a "/" in it, that is minor at
this point. What really concerns me is how the string "REBOL Web" keeps getting
into the output at the wrong spot. I inserted 'print statements after each
assignment to see what data was being dealt with, and I cannot find out how
s-tag is reading "REBOL Web" from a series that no longer has that string as a
member.

The obvious answer is that it DOES have that string as a member, but if that
were the case ... then what is the point of: "series: next series" which is
taken right from the examples of the new users guide?

I'd also like to note, for the record, that REBOL is _not_ that easy to learn.
I can program quite well in various BASIC's, PERL, JavaScript, C++, DCL (DEC
Command Language), and various batch & shell scripts - yet I am having a
dickens of a time learning REBOL! Maybe it would be much easier on me if REBOL
were my first language ...

%tagger.r
REBOL [
        TITLE: "Tagger"
        AUTHOR: "Steve Jarjoura"
        DATE: 25-JAN-2000
        PURPOSE: "To build up tags and return both start and end tags."
]

tagger: func
[
        series
        /local
                content
                s-tag
                e-tag
] [
        content: first series
print ["content= " content]
        series: next series
print ["series= " series]
        s-tag: build-tag series
print ["s-tag= " s-tag]
        e-tag: to-tag first series
print ["e-tag= " e-tag]
        return [s-tag content e-tag]
]


the output:

>> sample: ["REBOL Web" a href http://www.rebol.com/ border 0]
== ["REBOL Web" a href http://www.rebol.com/ border 0]
>> test: tagger sample
content=  REBOL Web
series=  a href http://www.rebol.com/ border 0
s-tag=  <="REBOL Web" a href="http://www.rebol.com/" border="0">
e-tag=  <a>
== [s-tag content e-tag]
>> print test
<="REBOL Web" a href="http://www.rebol.com/" border="0"> REBOL Web <a>

=====
Steve ~runester~ Jarjoura
"According to my calculations, that problem doesn't exist."
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Reply via email to