I ran this program and nothing happened so I added self halts and learned it can't even read the input file! Yet the File List tool reads it. Such dichotomy in behavior might be covered by a preference? I know MS Notepad, the simplest editor now allows one to store a file in ones's choice of formats. Does Squeak have a simple choice for input treatments that works in Win10?
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '<br>'; cr; lf]. ]]. inFIle close. outFile close.
It is my observation that Squeak is the last gasp uttered by a mouse when it fears death. It is not a normal sound they make unless they are being eaten by a Python! I hope the Python people don't release code that simply doesn't work.
Hi -
You've misplaced the ending ] of the block that you send #whileTrue: to.
Try:
[(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '<br>'; cr; lf]. ]. inFIle close. outFile close.
Also you probably want to wrap those file close method sends in an #ensure: block so it all looks like this:
[ [(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[outFile nextPutAll: line, '<br>'; cr; lf]. ] ensure: [ inFIle close. outFile close.]
So that when there is an error (or a halt) in the file processing code the files are closed properly. (And of course assuming nobody pulls the power cord).
Also here is the terse guide to Squeak
http://squeak.org/documentation/terse_guide/
On that page the Iteration section shows how to use the #whileTrue: idiom and in the File section has an example like you attempted to make.
And there are some free Smalltalk books available here:
http://stephane.ducasse.free.fr/FreeBooks.html
Often when I'm writing code (often bugs :/ ) it helps me to find the senders and implementors of methods and read how the methods I'm trying to use are used canonically.
Are you trying to interact with Python from your image? I think you'd have to use FFI if so. I'm not sure. Hopefully someone else can chime in.
Hope this helps
Paul
ReliableRobots.com wrote
I ran this program and nothing happened so I added self halts and learned it can't even read the input file! Yet the File List tool reads it. Such dichotomy in behavior might be covered by a preference? I know MS Notepad, the simplest editor now allows one to store a file in ones's choice of formats. Does Squeak have a simple choice for input treatments that works in Win10?
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '
<br> '; cr; lf]. ]]. inFIle close. outFile close.
It is my observation that Squeak is the last gasp uttered by a mouse when it fears death. It is not a normal sound they make unless they are being eaten by a Python! I hope the Python people don't release code that simply doesn't work.
-- View this message in context: http://forum.world.st/Squeak-File-Glitch-tp4955993p4956002.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
No, he always blames Smalltalk for his mistakes (like Donnie DDD Trump, just blame someone else).
Sent from my iPhone
On Jul 20, 2017, at 23:44, Paul DeBruicker pdebruic@gmail.com wrote:
Hi -
You've misplaced the ending ] of the block that you send #whileTrue: to.
Try:
[(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '<br>'; cr; lf]. ]. inFIle close. outFile close.
Also you probably want to wrap those file close method sends in an #ensure: block so it all looks like this:
[ [(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[outFile nextPutAll: line, '<br>'; cr; lf]. ] ensure: [ inFIle close. outFile close.]
So that when there is an error (or a halt) in the file processing code the files are closed properly. (And of course assuming nobody pulls the power cord).
Also here is the terse guide to Squeak
http://squeak.org/documentation/terse_guide/
On that page the Iteration section shows how to use the #whileTrue: idiom and in the File section has an example like you attempted to make.
And there are some free Smalltalk books available here:
http://stephane.ducasse.free.fr/FreeBooks.html
Often when I'm writing code (often bugs :/ ) it helps me to find the senders and implementors of methods and read how the methods I'm trying to use are used canonically.
Are you trying to interact with Python from your image? I think you'd have to use FFI if so. I'm not sure. Hopefully someone else can chime in.
Hope this helps
Paul
ReliableRobots.com wrote
I ran this program and nothing happened so I added self halts and learned it can't even read the input file! Yet the File List tool reads it. Such dichotomy in behavior might be covered by a preference? I know MS Notepad, the simplest editor now allows one to store a file in ones's choice of formats. Does Squeak have a simple choice for input treatments that works in Win10?
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '
<br> '; cr; lf]. ]]. inFIle close. outFile close.
It is my observation that Squeak is the last gasp uttered by a mouse when it fears death. It is not a normal sound they make unless they are being eaten by a Python! I hope the Python people don't release code that simply doesn't work.
-- View this message in context: http://forum.world.st/Squeak-File-Glitch-tp4955993p4956002.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
Thanks for the ] catch, but that did not solve the problem. The halt still shows no contents in the file. The reason I know it's not a file name problem is I copied it from the File List Tool - Change Title display.
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. words size >0 ifTrue:[ outFile nextPutAll: line, '<br>'; cr; lf]. ]. inFIle close. outFile close.
Could it be you have a malware writer among the system release developers? I'd suspect John Pfersich. Even if it's not him, the likelihood of such a person in an open developer community is so high I'm looking at JAVA for reliability.
On Fri, Jul 21, 2017 at 12:07 AM, John Pfersich smalltalker2@mac.com wrote:
No, he always blames Smalltalk for his mistakes (like Donnie DDD Trump, just blame someone else).
Sent from my iPhone
On Jul 20, 2017, at 23:44, Paul DeBruicker pdebruic@gmail.com wrote:
Hi -
You've misplaced the ending ] of the block that you send #whileTrue: to.
Try:
[(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '<br>'; cr; lf]. ]. inFIle close. outFile close.
Also you probably want to wrap those file close method sends in an
#ensure:
block so it all looks like this:
[ [(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[outFile nextPutAll: line, '<br>'; cr; lf]. ] ensure: [ inFIle close. outFile close.]
So that when there is an error (or a halt) in the file processing code
the
files are closed properly. (And of course assuming nobody pulls the
power
cord).
Also here is the terse guide to Squeak
http://squeak.org/documentation/terse_guide/
On that page the Iteration section shows how to use the #whileTrue: idiom and in the File section has an example like you attempted to make.
And there are some free Smalltalk books available here:
http://stephane.ducasse.free.fr/FreeBooks.html
Often when I'm writing code (often bugs :/ ) it helps me to find the senders and implementors of methods and read how the methods I'm trying
to
use are used canonically.
Are you trying to interact with Python from your image? I think you'd
have
to use FFI if so. I'm not sure. Hopefully someone else can chime in.
Hope this helps
Paul
ReliableRobots.com wrote
I ran this program and nothing happened so I added self halts and
learned
it can't even read the input file! Yet the File List tool reads it.
Such
dichotomy in behavior might be covered by a preference? I know MS Notepad, the simplest editor now allows one to store a file in ones's choice of formats. Does Squeak have a simple choice for input treatments that
works
in Win10?
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '
<br> '; cr; lf]. ]]. inFIle close. outFile close.
It is my observation that Squeak is the last gasp uttered by a mouse
when
it fears death. It is not a normal sound they make unless they are
being
eaten by a Python! I hope the Python people don't release code that simply doesn't work.
-- View this message in context: http://forum.world.st/Squeak-
File-Glitch-tp4955993p4956002.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.
this entire article might be helpful but especially: http://www.catb.org/esr/faqs/smart-questions.html#beprecise
Which file has no contents?
Your halt is placed before the out file stream should have any content because the file processing loop has not been entered. When you send #newFileNamed: a new empty file is created.
When you check for file contents for the "in" file to know it has no content how do you do that?
When you follow senders and implementors of the methods you're using how are they used?
As for John, I think he's just highlighting this point in the above article: http://www.catb.org/esr/faqs/smart-questions.html#courtesy and http://www.catb.org/esr/faqs/smart-questions.html#keepcool
Good luck sorting out the myriad issues you've raised in these messages.
ReliableRobots.com wrote
Thanks for the ] catch, but that did not solve the problem. The halt still shows no contents in the file. The reason I know it's not a file name problem is I copied it from the File List Tool - Change Title display.
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. words size >0 ifTrue:[ outFile nextPutAll: line, '
<br> '; cr; lf]. ]. inFIle close. outFile close.
Could it be you have a malware writer among the system release developers? I'd suspect John Pfersich. Even if it's not him, the likelihood of such a person in an open developer community is so high I'm looking at JAVA for reliability.
On Fri, Jul 21, 2017 at 12:07 AM, John Pfersich <
smalltalker2@
> wrote:
No, he always blames Smalltalk for his mistakes (like Donnie DDD Trump, just blame someone else).
Sent from my iPhone
On Jul 20, 2017, at 23:44, Paul DeBruicker <
pdebruic@
> wrote:
Hi -
You've misplaced the ending ] of the block that you send #whileTrue:
to.
Try:
[(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '
<br> '; cr; lf]. > > ]. > > inFIle close. > > outFile close. > > > > Also you probably want to wrap those file close method sends in an > #ensure: > > block so it all looks like this: > > > > [ > > [(line := inFIle nextLine) notNil] > > whileTrue:[ > > words := line substrings. > > self halt. > > words size >0 > > ifTrue:[outFile nextPutAll: line, ' <br> '; cr; lf]. > > ] ensure: > > [ > > inFIle close. > > outFile close.] > > > > So that when there is an error (or a halt) in the file processing code > the > > files are closed properly. (And of course assuming nobody pulls the > power > > cord). > > > > > > > > Also here is the terse guide to Squeak > > > > http://squeak.org/documentation/terse_guide/ > > > > On that page the Iteration section shows how to use the #whileTrue: > idiom > > and in the File section has an example like you attempted to make. > > > > > > > > And there are some free Smalltalk books available here: > > > > > > http://stephane.ducasse.free.fr/FreeBooks.html > > > > > > Often when I'm writing code (often bugs :/ ) it helps me to find the > > senders and implementors of methods and read how the methods I'm trying > to > > use are used canonically. > > > > > > Are you trying to interact with Python from your image? I think you'd > have > > to use FFI if so. I'm not sure. Hopefully someone else can chime in. > > > > > > Hope this helps > > > > > > Paul > > > > > > > > ReliableRobots.com wrote > >> I ran this program and nothing happened so I added self halts and > learned > >> it can't even read the input file! Yet the File List tool reads it. > Such > >> dichotomy in behavior might be covered by a preference? I know MS > >> Notepad, > >> the simplest editor now allows one to store a file in ones's choice of > >> formats. Does Squeak have a simple choice for input treatments that > works > >> in Win10? > >> > >> do > >> "Read a Bible file, reformat for beter readability and html > standards." > >> | inPath ootPath inFIle outFile line words | > >> inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. > >> ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. > >> inFIle := FileStream oldFileNamed: inPath. > >> outFile := FileStream newFileNamed: ootPath. > >> self halt. > >> [(line := inFIle nextLine) notNil > >> whileTrue:[ > >> words := line substrings. > >> self halt. > >> words size >0 ifTrue:[ > >> outFile nextPutAll: line, ' > >> <br> > >> '; cr; lf]. > >> ]]. > >> inFIle close. > >> outFile close. > >> > >> > >> It is my observation that Squeak is the last gasp uttered by a mouse > when > >> it fears death. It is not a normal sound they make unless they are > being > >> eaten by a Python! I hope the Python people don't release code that > >> simply doesn't work. > > > > > > > > > > > > -- > > View this message in context: http://forum.world.st/Squeak- > File-Glitch-tp4955993p4956002.html > > Sent from the Squeak - Dev mailing list archive at Nabble.com. > > > >
-- View this message in context: http://forum.world.st/Squeak-File-Glitch-tp4955993p4956131.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
When you check for file contents for the "in" file to know it has no
content how do you do that?
Using the halt walkback, window, I look at the variable inFile using inspect then look at contents which all show up as a few lines of empty squares, whatever that character is. Using the File List Tool the file his an HTML file filled with ordinary ASCII words and html tags.
Again the OS is Win10, the Squeak is 5.1
On Fri, Jul 21, 2017 at 11:07 AM, Paul DeBruicker pdebruic@gmail.com wrote:
this entire article might be helpful but especially: http://www.catb.org/esr/faqs/smart-questions.html#beprecise
Which file has no contents?
Your halt is placed before the out file stream should have any content because the file processing loop has not been entered. When you send #newFileNamed: a new empty file is created.
When you check for file contents for the "in" file to know it has no content how do you do that?
When you follow senders and implementors of the methods you're using how are they used?
As for John, I think he's just highlighting this point in the above article: http://www.catb.org/esr/faqs/smart-questions.html#courtesy and http://www.catb.org/esr/faqs/smart-questions.html#keepcool
Good luck sorting out the myriad issues you've raised in these messages.
ReliableRobots.com wrote
Thanks for the ] catch, but that did not solve the problem. The halt still shows no contents in the file. The reason I know it's not a file name problem is I copied it from the File List Tool - Change Title display.
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. words size >0 ifTrue:[ outFile nextPutAll: line, '
<br> '; cr; lf]. ]. inFIle close. outFile close.
Could it be you have a malware writer among the system release
developers?
I'd suspect John Pfersich. Even if it's not him, the likelihood of such
a
person in an open developer community is so high I'm looking at JAVA for reliability.
On Fri, Jul 21, 2017 at 12:07 AM, John Pfersich <
smalltalker2@
> wrote:
No, he always blames Smalltalk for his mistakes (like Donnie DDD Trump, just blame someone else).
Sent from my iPhone
On Jul 20, 2017, at 23:44, Paul DeBruicker <
pdebruic@
> wrote:
Hi -
You've misplaced the ending ] of the block that you send #whileTrue:
to.
Try:
[(line := inFIle nextLine) notNil] whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '
<br> '; cr; lf]. > > ]. > > inFIle close. > > outFile close. > > > > Also you probably want to wrap those file close method sends in an > #ensure: > > block so it all looks like this: > > > > [ > > [(line := inFIle nextLine) notNil] > > whileTrue:[ > > words := line substrings. > > self halt. > > words size >0 > > ifTrue:[outFile nextPutAll: line, ' <br> '; cr; lf]. > > ] ensure: > > [ > > inFIle close. > > outFile close.] > > > > So that when there is an error (or a halt) in the file processing code > the > > files are closed properly. (And of course assuming nobody pulls the > power > > cord). > > > > > > > > Also here is the terse guide to Squeak > > > > http://squeak.org/documentation/terse_guide/ > > > > On that page the Iteration section shows how to use the #whileTrue: > idiom > > and in the File section has an example like you attempted to make. > > > > > > > > And there are some free Smalltalk books available here: > > > > > > http://stephane.ducasse.free.fr/FreeBooks.html > > > > > > Often when I'm writing code (often bugs :/ ) it helps me to find the > > senders and implementors of methods and read how the methods I'm
trying
to
use are used canonically.
Are you trying to interact with Python from your image? I think you'd
have
to use FFI if so. I'm not sure. Hopefully someone else can chime in.
Hope this helps
Paul
ReliableRobots.com wrote
I ran this program and nothing happened so I added self halts and
learned
it can't even read the input file! Yet the File List tool reads it.
Such
dichotomy in behavior might be covered by a preference? I know MS Notepad, the simplest editor now allows one to store a file in ones's choice
of
formats. Does Squeak have a simple choice for input treatments that
works
in Win10?
do "Read a Bible file, reformat for beter readability and html
standards."
| inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus
Words\Matthew2.html'.
inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '
<br> > >> '; cr; lf]. > >> ]]. > >> inFIle close. > >> outFile close. > >> > >> > >> It is my observation that Squeak is the last gasp uttered by a mouse > when > >> it fears death. It is not a normal sound they make unless they are > being > >> eaten by a Python! I hope the Python people don't release code that > >> simply doesn't work. > > > > > > > > > > > > -- > > View this message in context: http://forum.world.st/Squeak- > File-Glitch-tp4955993p4956002.html > > Sent from the Squeak - Dev mailing list archive at Nabble.com. > > > >
-- View this message in context: http://forum.world.st/Squeak- File-Glitch-tp4955993p4956131.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
Thu shalt never surround your code by square brackets in vain.
2017-07-21 6:13 GMT+02:00 ReliableRobots.com reliablerobots@gmail.com:
I ran this program and nothing happened so I added self halts and learned it can't even read the input file! Yet the File List tool reads it. Such dichotomy in behavior might be covered by a preference? I know MS Notepad, the simplest editor now allows one to store a file in ones's choice of formats. Does Squeak have a simple choice for input treatments that works in Win10?
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '<br>'; cr; lf]. ]]. inFIle close. outFile close.
It is my observation that Squeak is the last gasp uttered by a mouse when it fears death. It is not a normal sound they make unless they are being eaten by a Python! I hope the Python people don't release code that simply doesn't work.
Nicolas Cellier wrote:
Thu shalt never surround your code by square brackets in vain.
+1
I would add:
'Thou shalt not take the name of the Squeak thy Smalltalk in vain'.
-- View this message in context: http://forum.world.st/Squeak-File-Glitch-tp4955993p4956209.html Sent from the Squeak - Dev mailing list archive at Nabble.com.
On Jul 20, 2017 21:14, "ReliableRobots.com" reliablerobots@gmail.com wrote:
I ran this program and nothing happened so I added self halts and learned it can't even read the input file! Yet the File List tool reads it. Such dichotomy in behavior might be covered by a preference? I know MS Notepad, the simplest editor now allows one to store a file in ones's choice of formats. Does Squeak have a simple choice for input treatments that works in Win10?
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '<br>'; cr; lf]. ]]. inFIle close. outFile close.
It is my observation that Squeak is the last gasp uttered by a mouse when it fears death. It is not a normal sound they make unless they are being eaten by a Python! I hope the Python people don't release code that simply doesn't work.
I too am often frustrated by code that will just not work. When I wish to blame the libraries I use, I end up asking myself "how likely is it that the bug is in my code, written by a single frail, weak human, versus a big in code used every day, in anger, by thousands of people?" I am hardly humble, but this thought does help me at least try to practice humility. It is almost always the case that the error end up being mine.
frank
If this code is used by thousands of people, it also fails for thousands of people. I have had two Smalltalk jobs plus ran a Smalltalk SIG so I'm not in need of humility on Smalltalk unless and until you can show me my mistake. I even tried copying the file access code used by the file list tool and that did not work either. So I suspect it is a bad version of the VM.
I will try to locate an older version to confirm. It is amazing how many commentators fail to even try out the code to confirm or refute my discovery BEFORE providing commentary. Is that true humility?
On Sat, Jul 22, 2017 at 8:22 AM, Frank Shearar frank.shearar@gmail.com wrote:
On Jul 20, 2017 21:14, "ReliableRobots.com" reliablerobots@gmail.com wrote:
I ran this program and nothing happened so I added self halts and learned it can't even read the input file! Yet the File List tool reads it. Such dichotomy in behavior might be covered by a preference? I know MS Notepad, the simplest editor now allows one to store a file in ones's choice of formats. Does Squeak have a simple choice for input treatments that works in Win10?
do "Read a Bible file, reformat for beter readability and html standards." | inPath ootPath inFIle outFile line words | inPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew.html'. ootPath := 'C:\Users\Owner\Desktop\Website\Jesus Words\Matthew2.html'. inFIle := FileStream oldFileNamed: inPath. outFile := FileStream newFileNamed: ootPath. self halt. [(line := inFIle nextLine) notNil whileTrue:[ words := line substrings. self halt. words size >0 ifTrue:[ outFile nextPutAll: line, '<br>'; cr; lf]. ]]. inFIle close. outFile close.
It is my observation that Squeak is the last gasp uttered by a mouse when it fears death. It is not a normal sound they make unless they are being eaten by a Python! I hope the Python people don't release code that simply doesn't work.
I too am often frustrated by code that will just not work. When I wish to blame the libraries I use, I end up asking myself "how likely is it that the bug is in my code, written by a single frail, weak human, versus a big in code used every day, in anger, by thousands of people?" I am hardly humble, but this thought does help me at least try to practice humility. It is almost always the case that the error end up being mine.
frank
squeak-dev@lists.squeakfoundation.org