smacc

How can I parse character in a File in Squeak4.1?

ⅰ亾dé卋堺 提交于 2019-12-12 06:13:34
问题 friend, suppose I have a file test.txt, the content of file is "1+2*3", if the fomular directly expressed in Squeak's Workspace, print it will result 9 , What I want to get is 7 then I read the file content 1+2*3 from a file. code like this and it works well ReadFrom "read the equation from ./formular.txt" | fileContents | fileContents := FileStream readOnlyFileNamed: 'test.txt' do: [:f | f contents ]. ^fileContents. but how can I store the 5 caracters of string "1+2*3" into a collection ,