Tendo City
Visual Basic geniuses - Printable Version

+- Tendo City (https://www.tendocity.net)
+-- Forum: Tendo City: Metropolitan District (https://www.tendocity.net/forumdisplay.php?fid=4)
+--- Forum: Ramble City (https://www.tendocity.net/forumdisplay.php?fid=44)
+--- Thread: Visual Basic geniuses (/showthread.php?tid=3368)



Visual Basic geniuses - N-Man - 27th November 2005

Okay what's wrong with this:

do until frmxx.height = 5000
frmxx.height = frmxx.height + 200
pause = 500000
loop

Whenever the action is performed, it crashes the program. I understand it's painfully simple, but it's Intro to VB and besides I'm probably retarded, so enlighten me plz.


Visual Basic geniuses - Sacred Jellybean - 27th November 2005

Huh... looks like it takes the vertical size of the form and adds 200 to it until the height = 5000. Making it bigger and bigger.

I dunno... try changing the one line to
"do until frmxx.height <= 5000"
and see what happens. I have no clue as to what would be causing the crash, though. VB forms are sometimes a pain.


Visual Basic geniuses - N-Man - 27th November 2005

Yeah, basically what I'm trying to do is get the form to a certain height with a smooth scrolling effect (rather than just do frmxx.height = 5000). I have the pleasure to report that your suggestion did not end up in a crash, however it also didn't do what I wanted (nor did it do anything really). I think the problem might be that it just keeps on looping or something, not sure. Should there be something like End Loop at the end? Or is there something wrong with the pause?


Visual Basic geniuses - Sacred Jellybean - 27th November 2005

Without a larger scope of the program (i.e. where "pause" is declared and changed... you know, comments are convenient ;)), I can't help you. How's it not working the way you want it to?


Visual Basic geniuses - N-Man - 27th November 2005

I'm trying to make the height of an object change visibly - basically I want the program to do: object's height + a certain number, then pause for a certain amount of milliseconds (or however much it is), then start over... until the object's height has reached a certain number. Considering the pause is barely visible, there should be sort of a scrolling, expanding effect. What's happening now is the height just keeps on growing indefinitely, thus crashing the program.


Visual Basic geniuses - Sacred Jellybean - 27th November 2005

I'm not sure how to do that... but try to find a Time() type of function that lets you halt the program. I used to know how to do that off the top of my head. Like, a year ago.

Anyway, put whatever function/phrase allows you to pause the program in that loop. It's otherwise fine.


Visual Basic geniuses - lazyfatbum - 28th November 2005

Hmm, yeah... I think the problem.... might be that you're Canadian....

Try speaking with a Mexican accent next time, or atleast dont mention Dave Foley or any affiliation to the UK. I would also take a look at that loop thing you're doing since it seems to tell it continue doing something by way of 'looping', which in layman's terms is to create a 'circle', such a pentagram, to communicate to lucifer and destroy man kind.

Be sure to look for 'white rabbit objects' as well. Big pain in the ass, I know, but we dont need Lawrence Fishburn in tight leather pants ever again. Or atleast in my lifetime.

Btw, wtf happened? Now we have the 'VGA' on Spike TV hosted by Samuel L. "Penis Fingers" Jackson? And I didn't see a single Nintendo game except Link tucked away in the crowds of animated characters that no one knows because they're all from WW2 games or Halo. Fucking Spike TV needs to stick to James Bond marathons and 80's TV shows.

Samuel L. Jackson to video games is like pairing up Bridget Fonda with ....anything. It just doesn't belong. A$nd he's all threatening in the ads too. Like, "YOU WILL WATCH BECAUSE I'M SAMUEL L. JACKSON" and i'm just, i'm over it. Okay, done.

Sorry.

*goes back to playing imaginary PDZ*


Visual Basic geniuses - N-Man - 28th November 2005

For everyone's general culture, the correct equation was:

Do Until frmxx.height = 5000
frmxx.height = frmxx.height + 200
For Pause = 1 to 500000
Next
Loop

Also I strongly support pentagrams and leather pants.


Visual Basic geniuses - lazyfatbum - 28th November 2005

Yeah, you would. *points to your Catholosism*


Visual Basic geniuses - Sacred Jellybean - 29th November 2005

Quote:and i'm just, i'm over it. Okay, done.

How, tell me HOW did you get over it. I'll pull my boxers to my ankles for 100 priests while saying 100 hail marys backwards (they start to sound like "smart ass" after a while), just tell me, Sammy, WHYYYY?!!

Although I've never actually seen these commercials. I wouldn't be surprised if they were inspired by that Samuel Jackson beer thing on Dave Chappelle, the one my friends used to quote NON-STOP.

But WHY? I mean, like, in one of his first roles he was in this racial movie where he was an escaped slave who stuck it to the white man by running north and saying "I am a free man", but in a very subdued and scary (because he's black and they're scary and unpredictable and violent people *tremble*) way, none of this, SAMUEL L JACKSON ESPOUSES SPIKE TV CAPITALIZING ON THE COMMERCIALIZATION OF VIDEO GAMES DRINK BEER BITCH. Don't you see? He's NOT a free man. He's Spike TV's bitch, now. How'd they get him to do a commercial? Someone must have... (ready for the pun? I promise, it's a punny one) ... ... ... SPIKED ... ... his drink ... !

*titwit*


Visual Basic geniuses - Sacred Jellybean - 29th November 2005

BTW - N-Man: it looks as though you are creating a pause by taking up processing time by setting off a loop that does nothing. It'll probably be okay if you don't plan to use the program on other systems, and it'll probably behave differently, based on how much work your processor has to do. It's pretty much just a waste of processing time. Putting the program to a halt would be more efficient. You would just find a function to halt/delay the program for a specified number of seconds, and replace the loop with that.

But if this is pretty much just a personal application with no intended widespread use, you probably don't care about efficiency.


Visual Basic geniuses - Laser Link - 29th November 2005

I don't know VB at all, but just a general programming tip:

You have to be careful what you set frmxx.height to. If it is 0 (or you didn't give it any value, it is probably initialized to 0, but VB may be wierd...), you are fine. But if you set it to some other value, say 500 (or any other number that is not divisible by 200), your program will be in an infinite loop and that is probably enough to kill VB. Does that make sense? If not, I'll explain.

A better practice would be to test for frmxx.height >= 5000, break the loop when you find that, and then explicitly set frmxx.height to 5000. There are a lot of other options as well, depending on your desired functionality.

And I successfully posted a comment about VB without making any derogatory comments. Amazing. Unless that counts as one...


Visual Basic geniuses - lazyfatbum - 29th November 2005

hahaha you're going straight to hell. :D

I say we bring back slavery and teach these negros a lesson they wont soon forget. Capatalize on MY commercialism will you? SCOFF! We invented commercialism and we did so without the use of coloreds!

Lucifer: .....look I just want to hit people with chains and make them feel guilty for things, you guys are just plain sick.

Samuel L. Jackson: Nigga yo ass best be gettin Nike shoes motherfucka or I bust yo shit up honkey bitch i tear off that little pink dick and watch yo bologna smellin ass bleed to death, shit make me tell you buy the damn shoes, got better things to do, movie star mother fucker, aint got time for this fuckin shit *begins to trail off* bust out yo teeth make you suck my black snake put something hot and black in you and aint talkin bout no latte frappachino banana-berry starbucks bullshit yo cracka ass KIA drivin ignorant piece of shit I get my knife out and-

Nike - We tear your little pink dick off, bitch.

Middle class white kids: yay! i'm an adult! *buys Nike shoes by the truck load*


Visual Basic geniuses - Dark Jaguar - 29th November 2005

Pseudo-adult powers, activate! Form of, mortgage!


Visual Basic geniuses - etoven - 17th December 2005

The solution as I found it is to use a timer control.
  1. create a timer control on the form
  2. I set it to fire every 1 sec by setting its interval value to 100 (1ms * 100ms per sec = 1 Sec)
  3. In side the timer code:
    1. if the condition: frmxx.height <= DESIRED HEIGHT then
    2. frmxx.height = frmxx.height + 1
There where 2 problems with your code:


  1. The form load event takes place before the actioul form is drawn so any change to the form size will not been seen until the first form paint event, which is not fired until after form load.
  2. pause = 50000 does not have the efect of pausing the event hander instead it creates a varable called pause and gives it a integer value of 50000.
For details see attaced project file.
Hope this helps....


Visual Basic geniuses - nickdaddyg - 1st January 2006

i'm glad i don't have to do that stuff anymore. in CIS 220 we did lots of visual basic, but VBA for excel (using the macros and all) that was a bitch. still got an A though.