List trouble(VID style)
[1/3] from: ammoncooke::yahoo::com at: 28-May-2001 18:49
Hi,
I need to add data to the following list:
lab "Generated:" gen: list 400X210 [
origin 0
across
text 200
text 200
]
but when I try to do so with:
append gen/data [
["info" "More Info"]
["more info" "even more Info"]
]
it returns:
** Script Error: append expected series argument of type: series port
** Where: do-body
** Near: append gen/data [
["info" "More Info"]
["more info" "even more Info"]
]
What is a series port???? I have been all over the core.pdf looking for it.
Thanks!!
Ammon
[2/3] from: robert:lancaster:opennw at: 29-May-2001 13:03
I prefer to use LIST with SUPPLY. As it seems to update automatically when
things are added to the list beign displayed. (providing you call show once
its updated...
Run the following in a file and click on "Add DOS" or "Add Serial". To see
things being added...
REBOL [
]
print "Starting"
default_dos: make object! [
type: 'Dos
name: copy "Blank Dos"
dos_command: copy ""
output: copy ""
run: does [
catch [
try [ call/output dos_command output ]
]
]
edit: does [
inform layout [
h2 "Dos Command"
across
text black "Name " field name [
name: copy face/text
]
text black "Command" field dos_command [
dos_command: copy face/text
]
return
output_field: field 200x200 output [ ]
return
button "Execute" [
run
output_field/text: copy output
show output_field
]
]
]
]
default_serial: make object! [
type: 'Rebol
name: copy "Blank Rebol"
command: copy " ; Comment "
output: copy ""
run: does [
catch [
try [
output: to-string do command
if equal? output none [
output: "No Output"
]
]
]
]
edit: does [
inform layout [
across
h2 "Rebol Command"
return
text black "Name " field name [
name: copy face/text
]
return
text black "Command"
field command [
command: copy face/text
]
return
output_field: field 200x200 [ ]
return
button "Execute" [
run
output_field/text: copy output
show output_field
]
]
]
]
command_list: copy []
command_offset: 0
master: layout [
below
l: list 200x100 [
across
b: text 100x20 [
face/data/run
if not equal? output none [
; Don't update the output field if nothing exists in
the
; field if the object
output/text: copy face/data/output
]
show output
][
face/data/edit
show master
]
t: text 100x20
]
supply [
temp-offset: add command_offset count
if temp-offset > length? command_list [
b/show?: false
t/show?: false
break
]
b/text: reduce [ to-string command_list/:temp-offset/name ]
b/data: command_list/:temp-offset
b/show?: true
either equal? none in command_list/:temp-offset 'type [
;If "type" does not exist in the object
t/show?: false
][
;If there exists a type value in the object display it
t/text: copy to-string command_list/:temp-offset/type
t/show?: true
]
]
return
list_slide: slider 20x100 [
command_offset: to-integer multiply face/data length?
command_list
if greater? add command_offset length? command_list add length?
command_list 5 [
command_offset: subtract length? command_list 5
]
show l
]
return
button "Shrink" [
either equal? face/data TRUE [
face/data: FALSE
output/size: 50x50
][
face/data: TRUE
output/size: 400x400
]
output_slider_y/size: make pair! reduce [ 20 pick output/size 1 ]
show output_slider_y
show master
]
add_dos: button "Add Dos" [
temp: make default_dos []
insert command_list temp
show master
]
add_serial: button "Add Serial" [
insert command_list make default_serial []
show master
]
return
button "Save List" [
save %save_list.r command_list
show master
]
button "Load List" [
command_list: reduce load %save_list.r
print command_list
show master
]
below return
across
output: field 400x400
output_slider_y: slider [ make pair! reduce [ pick output/size 2 400 ] ]
[
output/para/scroll: make pair! reduce [ 0
to-integer multiply
face/data
subtract
pick output/size 2
pick size-text output 2
]
show output
]
return
output_slider_x: slider does [ make pair! reduce [ pick output/size 1 20
] ] [
output/para/scroll: make pair! reduce [
to-integer multiply
face/data
subtract
pick output/size 1
pick size-text output 1
0
]
output_slider_x/size: make pair! reduce [ pick output/size 1 20 ]
show output
]
]
view master
[3/3] from: arolls:bigpond:au at: 30-May-2001 15:07
It means 'append expects a series OR a port
for its argument.
> ** Script Error: append expected series argument of type: series port
> ** Where: do-body
<<quoted lines omitted: 6>>
> Thanks!!
> Ammon
Make a small function yourself to see:
f: func [arg [block! integer!]][probe arg]
f
** Script Error: f expected arg argument of type: block integer
** Where: halt-view
** Near: f
Anton.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted