Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Pointer, values in Forms? Was: Editing fields of a record in forms? - second problem

From: yvan_iigs:gmx at: 10-Sep-2007 11:45

Hello, I like to thank the person who told me to read the sources and to use do-events. Unfortunately I don't remember who it was. Now the function works but it doest something that it shouldn,t. Here again the basic idea. 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 Part 3 does not work for example: a: ["dada"] b: Edit-ActorRole a but the value of a is also changed and this should not be,
>> b
== [["Yvan"]] ; this is good, the value Ichanged it in the form
>> a
== ["Yvan"] ; this should not be
>>
here the code. REBOL [] Edit-ActorRole: func [ actor-block [block!] /local l-act-role-block l-actor-block ] [ l-act-role-block: copy [] ; I use the copy function to be sure not to use a pointer. l-actor-block: copy actor-block 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" [ l-actor-block: copy [] if not (Fact1/text = "") [append l-actor-block Fact1/text] append/only l-act-role-block l-actor-block unview ] ] do-events; return l-act-role-block ] Mit freundlichen Gr=FCssen Yvan =