NationStates Jolt Archive


Visual Basic

Dehny
19-12-2005, 23:09
could someone please show me how to do a Rounding fucntion

Let dblTransferTime = (txtDirectory.Text * 1024 * 8) / 270

and then ive gt to round dblTransferTime
Legless Pirates
19-12-2005, 23:13
Old School! Rock on!
Cheese penguins
19-12-2005, 23:13
round (dblTransferTime, ***)

*** is where you put to how many places, 1-100 or so.. have fun.

(just to show off and be a asshole... i just made a functional web browser in under 3 hours... :p)
Dehny
19-12-2005, 23:14
round (dblTransferTime, ***)

*** is where you put to how many places, 1-100 or so.. have fun.

comes up error expected: =
Cheese penguins
19-12-2005, 23:17
oh right sorry.

you need a variable name in front with an equals e.g.

Randomvariable = round (dblTransferTime, ***)

then.

form1.print randomvariable

that should work now...

o and dim randomvariable as integer.
Jenrak
19-12-2005, 23:17
I'd help you, but I don't remember much of it anymore. I crushed out Visual Basic information with Java information, and I'm not enjoying the ride.
Dehny
19-12-2005, 23:19
oh right sorry.

you need a variable name in front with an equals e.g.

Randomvariable = round (dblTransferTime, ***)

then.

form1.print randomvariable

that should work now...

o and dim randomvariable as integer.

id have to keep randomvariable as a double otherwise i couldnt get the decimal point i need:p
Ifreann
19-12-2005, 23:20
I'd help but all this programming talk is making my brain melt
Cheese penguins
19-12-2005, 23:21
id have to keep randomvariable as a double otherwise i couldnt get the decimal point i need:p
whatever... you could just leave it as:
Dim randomvariable ( and that is not a implicit variable)

hell you may be able to get away without even declaring it at all...
Dehny
19-12-2005, 23:24
nah i need to declare it

thanks for your help

just need to figure out how to get the counter, Arrays, and comparison functions to work

easy rite :rolleyes: :( :( :( :( :(
Cheese penguins
19-12-2005, 23:26
nah i need to declare it

thanks for your help

just need to figure out how to get the counter, Arrays, and comparison functions to work

easy rite :rolleyes: :( :( :( :( :(
LOL sounds like your sitting higher computing... :p i doing all that crap at the moment too... thing is i know how to... if ya need anymore help just ask me... if you want to feel bad ask me to send you my browser and i show you what can be done in under 3 hours... :p
Cheese penguins
19-12-2005, 23:27
array.

Dim blahblah(4) as whatever

moooooooooo = blahblah 0 to 4

or summit like that... not good off top of head..
Eastern Coast America
19-12-2005, 23:28
Um. I use C++ and Qbasic. But I can give you one method of rounding.

Int y
float X = whatevernumber.
X = X + .5
Y = X
Dehny
19-12-2005, 23:29
LOL sounds like your sitting higher computing... :p i doing all that crap at the moment too... thing is i know how to... if ya need anymore help just ask me... if you want to feel bad ask me to send you my browser and i show you what can be done in under 3 hours... :p


indeed i am doing Higher Computing, hate Visual Basic

wrote the whole program in Actionscript in bout an hour but cant work Vb

dehny87@gmail.com, if you feel like making me feel bad by sending the browser

sexy_sk8r666@hotmail.com ,
Myrmidonisia
19-12-2005, 23:33
Um. I use C++ and Qbasic. But I can give you one method of rounding.

Int y
float X = whatevernumber.
X = X + .5
Y = X
This is my favorite. Works everywhere, fixed and floating point.
Eastern Coast America
19-12-2005, 23:37
This is my favorite. Works everywhere, fixed and floating point.

Remembering functions is annoying. I just write it this way because it makes logical sense.
Myrmidonisia
19-12-2005, 23:47
Remembering functions is annoying. I just write it this way because it makes logical sense.
Same here. I do a lot of DSP work in different assembly languages. This method works on TI, Motorola, Analog Devices, all of them. Plus, there aren't many DSPs that have rounding functions.
Cheese penguins
19-12-2005, 23:58
indeed i am doing Higher Computing, hate Visual Basic

wrote the whole program in Actionscript in bout an hour but cant work Vb

dehny87@gmail.com, if you feel like making me feel bad by sending the browser

sexy_sk8r666@hotmail.com ,
well gmail has crashed... so i cant send it via email but here is a download link... and im slipknotlover@gmail.com if ya need me for anything. (msn and email..)