Working with Chunks
Storing into Chunks
In addition to accessing a portion of a value, chunk expressions can also be used to store into a portion of a value, provided the thing being accessed is a container.
put "Jack Peterson" into name
put "d" into char 3 of last word of name
put "e" into char -2 of name
put "Olaf" into first word of name
put name --> "Olaf Pedersen"
You can also store something before or after a chunk:
put "The plant is growing" into phrase
put "egg" before word 2 of phrase
put " purple" after word 1 of phrase
put phrase --> "The purple eggplant is growing"
Storing into Chunk Ranges
When storing into chunk ranges, the entire range will be replaced:
put "The great grey green gooey goblin" into monster
put "ugly" into words 2 to 5 of monster
put monster --> "The ugly goblin"