@david. said:
A very simplified, imperfect, example.
Let's say you have 2 nice, big, powerful Ford F250 pickup trucks. One is bright red. The other is blue.
Class var for all trucks: maxGrossWeight = 3.5 (tons)
Instance var for truck #1: color = red
Instance var for truck #2: color = blue
Well, this is a very simplified explanation about variables, but it doesn't answer my question. For example if I want to make a webdialog interface and I include all my webdialog code inside a class.
class myWebdlg
def initialize
@my_app_name = 'Test window'
@myDlg = UI;;WebDialog.new(@my_app_name, false,"",200, 400, 600, 350, true)
@myDlg.set_file( "Example/my_html.html" )
end
def showDialog
@myDlg.show{}
@myDlg.bring_to_front
end
...#lot of code... (or cod, if it's about fishes)
end #class
In this example, it is OK to have instance variables? And if it is OK, why is? Or, if I'd better make them CLASS variables, why should I do that?