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.
Retention labels help you retain what you need and delete what you don't at the item level (document or email). They are also used to declare an item as a record as part of a records management solution for your Microsoft 365 data.
On the Settings page, under Permissions and Management, select Apply label to items in this list or library. On the Apply Label page, select the drop-down box, then select the label that you want to apply. The label you select will be automatically applied to all new files added to the document library beginning now.
Labels and values. Entering data into a spreadsheet is just like typing in a word processing program, but you have to first click the cell in which you want the data to be placed before typing the data. All words describing the values (numbers) are called labels.
If you aren't required to specifically use reduce, compose can be a better way of calling out the parts you want to be "left alone". Only things in parentheses will be evaluated, everything else untouched. So for instance:
append/only saved-data-block compose [contact-name: (get-face contact-name)]
Compose is often the clearest way to express boilerplate with little parts noted that you want to be evaluated. Of course, it's good to understand reduce too.
And here is another idea:
append/only saved-data-block repend [contact-name:] get-face contact-name
This time contact-name: isn't reduced, so it stays a set-word!, and the value from the form element is appended.
Doesn't look nice with the double append, but saves on key-strokes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With