Hello There, Guest! Register

Visual basic is shit and you guys need to fix this for me:= Fixed=
Dave
White Lighting - Extra 50% Free


Posts: 4,177
Joined: Jun 2008
#1
03-13-2011, 11:17 PM

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.


(This post was last modified: 03-14-2011, 12:20 AM by Dave.)
Reply
Negate
Born the same day as Linux... poor guy..


Posts: 766
Joined: Apr 2008
#2
03-13-2011, 11:50 PM

http://visualbasic.about.com/b/2008/10/1...object.htm
Those are the causes of that error and it sounds like your not initializing your variables.



Your in the minority, its supposed to taste like a shit taco
Jon Stewart
[move]ii@.[/move]
Reply
Dave
White Lighting - Extra 50% Free


Posts: 4,177
Joined: Jun 2008
#3
03-14-2011, 12:19 AM

(03-13-2011, 11:50 PM)negate link Wrote: http://visualbasic.about.com/b/2008/10/1...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.


(This post was last modified: 03-14-2011, 12:21 AM by Dave.)
Reply
Eschatos
Jack Thompson Fan Club Member


Posts: 4,447
Joined: Mar 2008
#4
03-14-2011, 09:52 AM

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



Reply
CaffeinePowered
Mad Hatter
*******

Posts: 12,998
Joined: Mar 2008
#5
03-14-2011, 11:13 AM

(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


[Image: caffsighl7.jpg]Â[Image: 1184299259221.gif]
Sig by Joel
Reply
Eschatos
Jack Thompson Fan Club Member


Posts: 4,447
Joined: Mar 2008
#6
03-14-2011, 04:03 PM

(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. 



Reply
zaneyard
Made with Whole Gainz (tm)
***

Posts: 6,930
Joined: Jun 2008
#7
03-15-2011, 01:47 PM

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


(04-09-2013, 11:24 PM)Dr. Zaius link Wrote:well i'm not really understanding how it's faster internet. and like google just magically rolls outs this stuff and it's 100 times faster than my internet? why? that doesn't set off any alarms to anyone?

(11-07-2012, 11:15 PM)at0m link Wrote:I MAY OR MAY NOT HAVE OVERINDULGED ON RUM AND COKES AT OUTBACK STEAKHOUSE

THE BARTENDER WAS BRAGGING ABOUT BEING A LEFTY. I SAID I WAS A RIGHTY, BUT THAT I COULD UNDO A BRA WITH JUST MY LEFT HAND. ASKED HER IF THAT COUNTED AS BEING AMBIDEXTROUS. SHE SAID 'NOT REALLY'. tHEN HANDED ME ANOTHER DRINK.

I COUN THAT AS A WIN

CUBA LIBRE
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)