I guess it’s written somewhere but maybe I use the wrong keywords…
I’d simply like to clear a content in a variable after pressing a button (via Shoes):
Shoes.app do
@text = edit_line
button "ok" do
@text = @text.text
para @text
@text.clear
if @text.nil? #to check if variable is empty
para "empty"
else
para "not empty"
end
end
end
for anybody who has problems to understand what this program is good for: This is just a test to find out how to clear content of a variable. Because I’d like to make something like a palindrom-tester and the part of clearing what’s inside of Variable. Because if I say to shoes at the end of the button-progress
....
@text = "" # instead of @text.clear
the whole program is not working anymore… Any idea?
just check if the String is empty:
@text.empty?