|
Pages: [1]
|
 |
|
Author
|
Topic: How to make append works like set ? (Read 226 times)
|
Hello
Guest
|
>> a: 'b == b >> set a "" == "" >> b == "" >> append a "Hello" ** Script Error: append expected series argument of type: series port ** Near: append a "Hello" >>
|
|
|
|
|
Logged
|
|
|
|
|
Sunanda
|
The problem is that you want to append to the string that is assigned to the word 'b, using the word 'a
'a is not a string -- it's a word assigned the value of 'b.
See:
a: 'b set a ""
print [type? a mold a] == word b print [type? b mold b] ==string ""
So you need to add code to overcome that level of indirection. One way:
set a append get a "hello"
print [type? a mold a] == word b print [type? b mold b] == string "hello"
Or just make a and b the same string:
b: copy "123" a: :b
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |