This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file | | |
file := 'filename.txt' asFileReference. | |
file ensureCreateFile. | |
file writeStreamDo: [ :stream | stream nextPutAll: 'Hello, World!' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| literal dynamic dynamicWithSemanticSugar | | |
literal := #(Bill Zoey Louis Francis). | |
dynamic := (Array new: 4) | |
at: 1 put: 'Bill'; | |
at: 2 put: 'Zoey'; | |
at: 3 put: 'Louis'; | |
at: 4 put: 'Francis'. | |
dynamicWithSemanticSugar := { 'Bill'. 'Zoey'. 'Louis'. 'Francis' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| array | | |
"For (With variable)" | |
1 to: 10 do: [ :i | Transcript show: i; cr ]. | |
"For (Without variable)" | |
10 timesRepeat: [ Transcript show: 'Iterating...'; cr ]. | |
"Foreach" | |
array := #(Bill Zoey Louis Francis). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"ZnEasy" | |
(ZnEasy getPng: 'https://pharo.org/web/files/pharo.png') asMorph openInWindow | |
"ZnClient" | |
ZnClient new | |
url: 'https://pharo.org'; | |
get. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GrowlMorph | |
openWithLabel: 'Hello!' | |
contents: 'This is a Description.' | |
color: (Color darkGray) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Red" | |
Color red. | |
"Green" | |
Color green. | |
"Blue" | |
Color blue. | |
"RGB" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''" | |
" _____ _ ____ _ _ _____ _ _ " | |
" | __ \ | | / __ \ (_) | | / ____| | | | | " | |
" | |__) || |__ __ _ _ __ ___ | | | | _ _ _ ___ | | __| (___ ___ | |_ _ _ _ __ ___ | |_ " | |
" | ___/ | '_ \ / _` || '__|/ _ \ | | | || | | || | / __|| |/ / \___ \ / _ \| __|| | | || '_ \ / __|| __|" | |
" | | | | | || (_| || | | (_) || |__| || |_| || || (__ | < ____) || __/| |_ | |_| || |_) |_ \__ \| |_ " | |
" |_| |_| |_| \__,_||_| \___/ \___\_\ \__,_||_| \___||_|\_\|_____/ \___| \__| \__,_|| .__/(_)|___/ \__|" | |
" | | " | |
" |_| V 0.5 " | |
"'''''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file fileContent | | |
file := 'test.png' asFileReference. | |
fileContent := ZnClient new | |
url: 'https://pharo.org/web/files/pharo.png'; | |
get. | |
file ensureCreateFile. | |
file binaryWriteStreamDo: [ :stream | stream nextPutAll: fileContent ] |