##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: October 2016 # Modified: 2016-10-09/21:29-0400 ##+ # # move.icn, demonstrate the string scanning move function # procedure main() # display first letter of each word, using counted moves s := "this is a test" s ? { write(move(1), " ", &pos) move(4) write(move(1), " ", &pos) move(2) write(move(1), " ", &pos) move(1) write(move(1), " ", &pos) } # outside of string scanning, move makes little sense # but can be used by explicitly setting &pos and &subject &pos := 1 &subject := "not scanning" write(move(3)) end