[REBOL] Editing fields of a record in forms?
From: yvan_iigs::gmx::net at: 22-Aug-2007 10:02
Hallo,
Hello,
Why is the code below not working?
What it should do is the following:
1. I have a block a with a string in it
2. Edit-ActorRole should open a form with the value of the string in block a
and let the user edit it if he wants.
3. The edited string should be returned to block b, letting block a
untouched
for example:
a: ["dada"]
b: Edit-ActorRole a
but the value of b is not changed and the script crashes.
REBOL []
Edit-ActorRole: func [ actor-block [block!]
/local l-act-role-block
l-actor-block ]
[
l-act-role-block: copy [] ;make sure it is empty, will
contain the return value
l-actor-block: copy actor-block ;copy content of actor-block to
l-actor-block so that actor-block keeps untouched
;Check if l-actor-block is empy, if yes feed with zero String ""
if (l-actor-block/1 = none) [append l-actor-block ""]
Formular: view/new layout
[
text "Actor 1:" Fact1: field l-actor-block/1
button #"^M""OK"
[
;as soon as OK is clicked l-actor-block is cleared and then refilled with
the values from the Fields
l-actor-block: copy []
if not (Fact1/text = "") [append l-actor-block Fact1/text]
append/only l-act-role-block l-actor-block
]
]
return l-act-role-block
]
Mit freundlichen Gr=FCssen