Be Right Back, Uninstalling
Visual basic is shit and you guys need to fix this for me:= Fixed= - Printable Version

+- Be Right Back, Uninstalling (https://www.brbuninstalling.com)
+-- Forum: General Category (https://www.brbuninstalling.com/forumdisplay.php?fid=49)
+--- Forum: General Discussion (https://www.brbuninstalling.com/forumdisplay.php?fid=59)
+--- Thread: Visual basic is shit and you guys need to fix this for me:= Fixed= (/showthread.php?tid=12493)



Visual basic is shit and you guys need to fix this for me:= Fixed= - Dave - 03-13-2011

lblFirstName.Text = NewPrisoner(i).strFirstName

is returning the old "Object reference not set to an instance of an object."

but i is an integer and NewPrisoner() is obviously an object

I thought maybe it wanted me to assign a value to NewPrisoner(0) as the function (the form loading) is called, so I set NewPrisoner(0).strFirstName to "Example" and I still got the error.

I then set i to 0 just to see if that changed anything, but still no.
I'm presuming when it said object reference it means the sub (), but it should be able to base the sub on the variable "i" even if "i" has not been assigned a variable? and to check it wasn't this I had set "i" to 0...

Mind fuck.

Someone with a formal education please explain what I'm obviously missing.

Thanks.


Re: Visual basic is shit and you guys need to fix this for me: - Negate - 03-13-2011

http://visualbasic.about.com/b/2008/10/19/object-reference-not-set-to-an-instance-of-an-object.htm
Those are the causes of that error and it sounds like your not initializing your variables.


Re: Visual basic is shit and you guys need to fix this for me: - Dave - 03-14-2011

(03-13-2011, 11:50 PM)negate link Wrote: http://visualbasic.about.com/b/2008/10/19/object-reference-not-set-to-an-instance-of-an-object.htm
Those are the causes of that error and it sounds like your not initializing your variables.

If that's true why did I get the same error when I assigned a value to NewPrisoner(0).strFirstName before?


-edit-
Proof read, when I declared NewPrisoner(i) as an array I wrote it as NewPrisoner()

Visual Basic was making shit up.


Re: Visual basic is shit and you guys need to fix this for me:= Fixed= - Eschatos - 03-14-2011

Why the fuck are they teaching you Visual Basic at Uni?


Re: Visual basic is shit and you guys need to fix this for me:= Fixed= - CaffeinePowered - 03-14-2011

(03-14-2011, 09:52 AM)Eschatos link Wrote: Why the fuck are they teaching you Visual Basic at Uni?

I was taught it, and I do use it at work for some excel stuff.

VB and Java are decent starting platforms for general programing before you get deeper into something like C. Its technically not "real" programing, but it can teach you the basics of proper coding


Re: Visual basic is shit and you guys need to fix this for me:= Fixed= - Eschatos - 03-14-2011

(03-14-2011, 11:13 AM)Caffeine link Wrote: [quote author=Eschatos link=topic=5512.msg199343#msg199343 date=1300114346]
Why the fuck are they teaching you Visual Basic at Uni?

I was taught it, and I do use it at work for some excel stuff.

VB and Java are decent starting platforms for general programing before you get deeper into something like C. Its technically not "real" programing, but it can teach you the basics of proper coding
[/quote]

I'd say I agree, but I've been teaching myself C++ and so far it's 90% as easy as Java. 


Re: Visual basic is shit and you guys need to fix this for me:= Fixed= - zaneyard - 03-15-2011

i learned vbs in server class for automating windows server tasks that should be automated already but windows is retarded