I am trying to save a few string values into a block so that I can save that block to a text file. I am getting these values from a form using VID.
One way to do this would be to simply save strings to the file. But I would prefer being able to retrieve the data as a block.
This is what I intend to do:
view layout [
contact-name: field
save-button: btn "Save" [
saved-data-block: copy []
append saved-data-block [[contact-name: contact-name/text]] ;problem here
save my-file saved-data-block
]
]
For an input like Rebol User
in the name field, the content stored in the file should be something like [contact-name: "Rebol User"]
, but the content is [contact-name: contact-name/text]
I understand that the problem is that the block is not being evaluated as code at the time I am appending it to saved-data-block
. What can I do to save the string value to the text file in a block-like manner? Should I be doing something else to achieve this? Any comments/queries are welcome.