Re: Help with seq's
On Thu, 28 Sep 2000 15:49:22 -0400, David Mosley wrote:
>At 10:50 AM 9/28/00 -0700, you wrote:
>>David,
>>
>>Hopefully this example will clear things up a bit for you:
>>
>
>
>>-- Test to make a seq This is the Part that I need help with
>>string1 = prompt_string( "Enter a string > " )
>>string2 = prompt_string( "Enter another string > " )
>>string3 = {string1,string2}
>
>>-- Brian
>>
>Hi Brian and fritz
>Thanks for the help so when you put 2 seq's together you need to put
>{string1,string2} it works in the program I am working on a program that
>will help people get to know all about seq's hopefully by the way I could
>not find that in the ref.man or lib.doc agian thanks for the help.
>
>David
>pmosley at infoway.lib.nm.us
actually, when I think of putting 2 sequences together, I
think 'concatenating 2 sequences' which means putting them together into
one sequence. For example:
----------
sequence string1, string2, string3
string1 = "string1"
string2 = "string2"
string3 = string1 & string2
----------
in the program above, we concatenated string1 and string2 so
string3 = "string1string2"
I'd call what we did in your program 'creating a sequence of 2 sequences'.
----------
sequence string1, string2, string3
string1 = "string1"
string2 = "string2"
string3 = {string1,string2}
----------
in the program above, we created a sequence of strings (which are sequences
of ASCII codes).
string3 = { "string1", "string2" }
= {{115,116,114,105,110,103,49},{115,116,114,105,110,103,50}}
there are other ways to do the same thing (making sequences of
strings/sequences)
For example:
----------
sequence string1, string2, string3
string1 = "string1"
string2 = "string2"
string3 = {string1}&{string2}
----------
or
----------
string3 = append({string1},string2)
----------
or
----------
string3 = prepend({string2},string1)
----------
will all give the same results:
string3 = { "string1", "string2" }
= {{115,116,114,105,110,103,49},{115,116,114,105,110,103,50}}
but be careful not to do this:
string3 = append(string1,string2)
because you'll get this:
instead of this:
Sometimes I still make mistakes like the last example and it just takes the
reference manual and a little trial & error to get the structure I'm
looking for.
-- Brian
|
Not Categorized, Please Help
|
|