Even so, otherwise so, hey Dudes, even... OMG, what have I done? Oh my God? Do I see a pattern? Even so.
Printable View
Even so, otherwise so, hey Dudes, even... OMG, what have I done? Oh my God? Do I see a pattern? Even so.
From CastBox.ctl:
Now, my first instinct is, wow, those hundreds of lines of code could easily be consolidated down to just a handful of lines, using loops. But then I realized, our society is such a "bottom line" "details, schme-tails" society that no one actually wants to read code, they just want a "big picture" of the code. And what better "big picture" is there than the size of the code. So, writing ridiculously verbose code actually gives the code legitimacy. Brilliant.Code:With UserControl
If .VScrollBar.Value = 0 Then
.txtMedia(1).Text = Data(1)
.Label1(1).Caption = "Cast Member: #1"
.Frame1(1).Caption = "1"
.txtMedia(2).Text = Data(2)
.Label1(2).Caption = "Cast Member: #2"
.Frame1(2).Caption = "2"
.txtMedia(3).Text = Data(3)
.Label1(3).Caption = "Cast Member: #3"
.Frame1(3).Caption = "3"
.txtMedia(4).Text = Data(4)
.Label1(4).Caption = "Cast Member: #4"
.Frame1(4).Caption = "4"
.txtMedia(5).Text = Data(5)
.Label1(5).Caption = "Cast Member: #5"
.Frame1(5).Caption = "5"
.txtMedia(6).Text = Data(6)
.Label1(6).Caption = "Cast Member: #6"
.Frame1(6).Caption = "6"
.txtMedia(7).Text = Data(7)
.Label1(7).Caption = "Cast Member: #7"
.Frame1(7).Caption = "7"
.txtMedia(8).Text = Data(8)
.Label1(8).Caption = "Cast Member: #8"
.Frame1(8).Caption = "8"
.txtMedia(9).Text = Data(9)
.Label1(9).Caption = "Cast Member: #9"
.Frame1(9).Caption = "9"
.txtMedia(10).Text = Data(10)
.Label1(10).Caption = "Cast Member: #10"
.Frame1(10).Caption = "10"
.txtMedia(11).Text = Data(11)
.Label1(11).Caption = "Cast Member: #11"
.Frame1(11).Caption = "11"
.txtMedia(12).Text = Data(12)
.Label1(12).Caption = "Cast Member: #12"
.Frame1(12).Caption = "12"
.txtMedia(13).Text = Data(13)
.Label1(13).Caption = "Cast Member: #13"
.Frame1(13).Caption = "13"
.txtMedia(14).Text = Data(14)
.Label1(14).Caption = "Cast Member: #14"
.Frame1(14).Caption = "14"
.txtMedia(15).Text = Data(15)
.Label1(15).Caption = "Cast Member: #15"
.Frame1(15).Caption = "15"
.txtMedia(16).Text = Data(16)
.Label1(16).Caption = "Cast Member: #16"
.Frame1(16).Caption = "16"
.txtMedia(17).Text = Data(17)
.Label1(17).Caption = "Cast Member: #17"
.Frame1(17).Caption = "17"
.txtMedia(18).Text = Data(18)
.Label1(18).Caption = "Cast Member: #18"
.Frame1(18).Caption = "18"
.txtMedia(19).Text = Data(19)
.Label1(19).Caption = "Cast Member: #19"
.Frame1(19).Caption = "19"
.txtMedia(20).Text = Data(20)
.Label1(20).Caption = "Cast Member: #20"
.Frame1(20).Caption = "20"
.txtMedia(21).Text = Data(21)
.Label1(21).Caption = "Cast Member: #21"
.Frame1(21).Caption = "21"
.txtMedia(22).Text = Data(22)
.Label1(22).Caption = "Cast Member: #22"
.Frame1(22).Caption = "22"
.txtMedia(23).Text = Data(23)
.Label1(23).Caption = "Cast Member: #23"
.Frame1(23).Caption = "23"
.txtMedia(24).Text = Data(24)
.Label1(24).Caption = "Cast Member: #24"
.Frame1(24).Caption = "24"
.txtMedia(25).Text = Data(25)
.Label1(25).Caption = "Cast Member: #25"
.Frame1(25).Caption = "25"
.txtMedia(26).Text = Data(26)
.Label1(26).Caption = "Cast Member: #26"
.Frame1(26).Caption = "26"
.txtMedia(27).Text = Data(27)
.Label1(27).Caption = "Cast Member: #27"
.Frame1(27).Caption = "27"
.txtMedia(28).Text = Data(28)
.Label1(28).Caption = "Cast Member: #28"
.Frame1(28).Caption = "28"
.txtMedia(29).Text = Data(29)
.Label1(29).Caption = "Cast Member: #29"
.Frame1(29).Caption = "29"
.txtMedia(30).Text = Data(30)
.Label1(30).Caption = "Cast Member: #30"
.Frame1(30).Caption = "30"
.txtMedia(31).Text = Data(31)
.Label1(31).Caption = "Cast Member: #31"
.Frame1(31).Caption = "31"
.txtMedia(32).Text = Data(32)
.Label1(32).Caption = "Cast Member: #32"
.Frame1(32).Caption = "32"
.txtMedia(33).Text = Data(33)
.Label1(33).Caption = "Cast Member: #33"
.Frame1(33).Caption = "33"
.txtMedia(34).Text = Data(34)
.Label1(34).Caption = "Cast Member: #34"
.Frame1(34).Caption = "34"
.txtMedia(35).Text = Data(35)
.Label1(35).Caption = "Cast Member: #35"
.Frame1(35).Caption = "35"
.txtMedia(36).Text = Data(36)
.Label1(36).Caption = "Cast Member: #36"
.Frame1(36).Caption = "36"
.txtMedia(37).Text = Data(37)
.Label1(37).Caption = "Cast Member: #37"
.Frame1(37).Caption = "37"
.txtMedia(38).Text = Data(38)
.Label1(38).Caption = "Cast Member: #38"
.Frame1(38).Caption = "38"
.txtMedia(39).Text = Data(39)
.Label1(39).Caption = "Cast Member: #39"
.Frame1(39).Caption = "39"
.txtMedia(40).Text = Data(40)
.Label1(40).Caption = "Cast Member: #40"
.Frame1(40).Caption = "40"
.txtMedia(41).Text = Data(41)
.Label1(41).Caption = "Cast Member: #41"
.Frame1(41).Caption = "41"
.txtMedia(42).Text = Data(42)
.Label1(42).Caption = "Cast Member: #42"
.Frame1(42).Caption = "42"
.txtMedia(43).Text = Data(43)
.Label1(43).Caption = "Cast Member: #43"
.Frame1(43).Caption = "43"
.txtMedia(44).Text = Data(44)
.Label1(44).Caption = "Cast Member: #44"
.Frame1(44).Caption = "44"
.txtMedia(45).Text = Data(45)
.Label1(45).Caption = "Cast Member: #45"
.Frame1(45).Caption = "45"
ElseIf .VScrollBar.Value <> 0 Then
.txtMedia(1).Text = Data(1)
.Label1(1).Caption = "Cast Member: #" & .VScrollBar.Value - 46
.Frame1(1).Caption = .VScrollBar.Value - 46
.txtMedia(2).Text = Data(2)
.Label1(2).Caption = "Cast Member: #" & .VScrollBar.Value - 45
.Frame1(2).Caption = .VScrollBar.Value - 45
.txtMedia(3).Text = Data(3)
.Label1(3).Caption = "Cast Member: #" & .VScrollBar.Value - 44
.Frame1(3).Caption = .VScrollBar.Value - 44
.txtMedia(4).Text = Data(4)
.Label1(4).Caption = "Cast Member: #" & .VScrollBar.Value - 43
.Frame1(4).Caption = .VScrollBar.Value - 43
.txtMedia(5).Text = Data(5)
.Label1(5).Caption = "Cast Member: #" & .VScrollBar.Value - 42
.Frame1(5).Caption = .VScrollBar.Value - 42
.txtMedia(6).Text = Data(6)
.Label1(6).Caption = "Cast Member: #" & .VScrollBar.Value - 41
.Frame1(6).Caption = .VScrollBar.Value - 41
.txtMedia(7).Text = Data(7)
.Label1(7).Caption = "Cast Member: #" & .VScrollBar.Value - 40
.Frame1(7).Caption = .VScrollBar.Value - 40
.txtMedia(8).Text = Data(8)
.Label1(8).Caption = "Cast Member: #" & .VScrollBar.Value - 39
.Frame1(8).Caption = .VScrollBar.Value - 39
.txtMedia(9).Text = Data(9)
.Label1(9).Caption = "Cast Member: #" & .VScrollBar.Value - 38
.Frame1(9).Caption = .VScrollBar.Value - 38
.txtMedia(10).Text = Data(10)
.Label1(10).Caption = "Cast Member: #" & .VScrollBar.Value - 37
.Frame1(10).Caption = .VScrollBar.Value - 37
.txtMedia(11).Text = Data(11)
.Label1(11).Caption = "Cast Member: #" & .VScrollBar.Value - 36
.Frame1(11).Caption = .VScrollBar.Value - 36
.txtMedia(12).Text = Data(12)
.Label1(12).Caption = "Cast Member: #" & .VScrollBar.Value - 35
.Frame1(12).Caption = .VScrollBar.Value - 35
.txtMedia(13).Text = Data(13)
.Label1(13).Caption = "Cast Member: #" & .VScrollBar.Value - 34
.Frame1(13).Caption = .VScrollBar.Value - 34
.txtMedia(14).Text = Data(14)
.Label1(14).Caption = "Cast Member: #" & .VScrollBar.Value - 33
.Frame1(14).Caption = .VScrollBar.Value - 33
.txtMedia(15).Text = Data(15)
.Label1(15).Caption = "Cast Member: #" & .VScrollBar.Value - 32
.Frame1(15).Caption = .VScrollBar.Value - 32
.txtMedia(16).Text = Data(16)
.Label1(16).Caption = "Cast Member: #" & .VScrollBar.Value - 31
.Frame1(16).Caption = .VScrollBar.Value - 31
.txtMedia(17).Text = Data(17)
.Label1(17).Caption = "Cast Member: #" & .VScrollBar.Value - 30
.Frame1(17).Caption = .VScrollBar.Value - 30
.txtMedia(18).Text = Data(18)
.Label1(18).Caption = "Cast Member: #" & .VScrollBar.Value - 29
.Frame1(18).Caption = .VScrollBar.Value - 29
.txtMedia(19).Text = Data(19)
.Label1(19).Caption = "Cast Member: #" & .VScrollBar.Value - 28
.Frame1(19).Caption = .VScrollBar.Value - 28
.txtMedia(20).Text = Data(20)
.Label1(20).Caption = "Cast Member: #" & .VScrollBar.Value - 27
.Frame1(20).Caption = .VScrollBar.Value - 27
.txtMedia(21).Text = Data(21)
.Label1(21).Caption = "Cast Member: #" & .VScrollBar.Value - 26
.Frame1(21).Caption = .VScrollBar.Value - 26
.txtMedia(22).Text = Data(22)
.Label1(22).Caption = "Cast Member: #" & .VScrollBar.Value - 25
.Frame1(22).Caption = .VScrollBar.Value - 25
.txtMedia(23).Text = Data(23)
.Label1(23).Caption = "Cast Member: #" & .VScrollBar.Value - 24
.Frame1(23).Caption = .VScrollBar.Value - 24
.txtMedia(24).Text = Data(24)
.Label1(24).Caption = "Cast Member: #" & .VScrollBar.Value - 23
.Frame1(24).Caption = .VScrollBar.Value - 23
.txtMedia(25).Text = Data(25)
.Label1(25).Caption = "Cast Member: #" & .VScrollBar.Value - 22
.Frame1(25).Caption = .VScrollBar.Value - 22
.txtMedia(26).Text = Data(26)
.Label1(26).Caption = "Cast Member: #" & .VScrollBar.Value - 21
.Frame1(26).Caption = .VScrollBar.Value - 21
.txtMedia(27).Text = Data(27)
.Label1(27).Caption = "Cast Member: #" & .VScrollBar.Value - 20
.Frame1(27).Caption = .VScrollBar.Value - 20
.txtMedia(28).Text = Data(28)
.Label1(28).Caption = "Cast Member: #" & .VScrollBar.Value - 19
.Frame1(28).Caption = .VScrollBar.Value - 19
.txtMedia(29).Text = Data(29)
.Label1(29).Caption = "Cast Member: #" & .VScrollBar.Value - 18
.Frame1(29).Caption = .VScrollBar.Value - 18
.txtMedia(30).Text = Data(30)
.Label1(30).Caption = "Cast Member: #" & .VScrollBar.Value - 17
.Frame1(30).Caption = .VScrollBar.Value - 17
.txtMedia(31).Text = Data(31)
.Label1(31).Caption = "Cast Member: #" & .VScrollBar.Value - 16
.Frame1(31).Caption = .VScrollBar.Value - 16
.txtMedia(32).Text = Data(32)
.Label1(32).Caption = "Cast Member: #" & .VScrollBar.Value - 15
.Frame1(32).Caption = .VScrollBar.Value - 15
.txtMedia(33).Text = Data(33)
.Label1(33).Caption = "Cast Member: #" & .VScrollBar.Value - 14
.Frame1(33).Caption = .VScrollBar.Value - 14
.txtMedia(34).Text = Data(34)
.Label1(34).Caption = "Cast Member: #" & .VScrollBar.Value - 13
.Frame1(34).Caption = .VScrollBar.Value - 13
.txtMedia(35).Text = Data(35)
.Label1(35).Caption = "Cast Member: #" & .VScrollBar.Value - 12
.Frame1(35).Caption = .VScrollBar.Value - 12
.txtMedia(36).Text = Data(36)
.Label1(36).Caption = "Cast Member: #" & .VScrollBar.Value - 11
.Frame1(36).Caption = .VScrollBar.Value - 11
.txtMedia(37).Text = Data(37)
.Label1(37).Caption = "Cast Member: #" & .VScrollBar.Value - 10
.Frame1(37).Caption = .VScrollBar.Value - 10
.txtMedia(38).Text = Data(38)
.Label1(38).Caption = "Cast Member: #" & .VScrollBar.Value - 9
.Frame1(38).Caption = .VScrollBar.Value - 9
.txtMedia(39).Text = Data(39)
.Label1(39).Caption = "Cast Member: #" & .VScrollBar.Value - 8
.Frame1(39).Caption = .VScrollBar.Value - 8
.txtMedia(40).Text = Data(40)
.Label1(40).Caption = "Cast Member: #" & .VScrollBar.Value - 7
.Frame1(40).Caption = .VScrollBar.Value - 7
.txtMedia(41).Text = Data(41)
.Label1(41).Caption = "Cast Member: #" & .VScrollBar.Value - 6
.Frame1(41).Caption = .VScrollBar.Value - 6
.txtMedia(42).Text = Data(42)
.Label1(42).Caption = "Cast Member: #" & .VScrollBar.Value - 5
.Frame1(42).Caption = .VScrollBar.Value - 5
.txtMedia(43).Text = Data(43)
.Label1(43).Caption = "Cast Member: #" & .VScrollBar.Value - 4
.Frame1(43).Caption = .VScrollBar.Value - 4
.txtMedia(44).Text = Data(44)
.Label1(44).Caption = "Cast Member: #" & .VScrollBar.Value - 3
.Frame1(44).Caption = .VScrollBar.Value - 3
.txtMedia(45).Text = Data(45)
.Label1(45).Caption = "Cast Member: #" & .VScrollBar.Value
.Frame1(45).Caption = .VScrollBar.Value
End If
End With
Seems kind of so so.
Thanks guys for the input here then
Actually, larger code lines are used often in programming to speed things up. Having a loop that does 2 things (obviously talking about the same thing, repeated) 1000 times is faster than a loop that does 1 thing 2000 times...the mere act of looping back to a point in the code causes a slight slowdown. Though not noticable in many cases (especially in VB where timings can be very variable, unlike in machine code) it does make a difference. In the days of the 8-bit home computing, demo coders would make use of this to make things happen considerably faster where split-millisecond timing (during a screen draw, for instance) was vital, and those demos that really showed off the capabilities of coders (like the ones with 1000s of sprites on screen at once, done by bit-blitting and keeping each sprite around a different line on-screen so only the limit was actually drawn).
Writing code without loops these days is considered wasteful (as it keeps code size down if you use a loop rather than repeating code) but that's because it really is milliseconds (barely registerable lengths of time) you're saving rather than the difference it used to take to do that loop. A good coder can read looped data as if it IS verbose code where the code is repeated multiple times, so legibility isn't a good excuse for avoiding loops as long as you comment well and know your code.
Horses for courses though...me, I prefer a 100k EXE file that can do everything rather than a 1MB EXE file that has been hacked to pieces because there's not enough space to fit everything in :-)
really, then???
even so.
Lol : ()+<
then, even so
!! Omg !!
Can we please get back to the OP posted for
It's your hobby project.
Unless you have actual programming related questions then I would say proceed with your project.
-- hey cool, thanks dude
All over you show, what you can do...
-- I am one of the lucky ones that purchased it, when it came out then so
Anymore comments, kindly please guys