Go Back   Talk Warez - Worlds Best Warez Site > Chat and Discussion > Programming

Reply

Sponsored Links Site powered by [Endless-4um.com]
 
LinkBack Thread Tools Display Modes
Visual Basic Commands
Old 07-20-2007   #1 (permalink)
Administrator
 
EnDLeSs's Avatar
 
Join Date: Jul 2007
Posts: 391
EnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond reputeEnDLeSs has a reputation beyond repute
Default Visual Basic Commands

Here are the VB operators used to perform mathematical operations on one or more variables. Aside from the normal multiply/add/substract and divide, you will find the AND, OR, Not Equal, MOD and Integer Division operators very useful.
Code:
/ - Normal division  
\ - Integer division (truncates the answer) 
^ - Exponentiation operator 
* - Multiply  
+ - Plus  
- - Minus  
= - Equal  
> - Greater Than  
< - Less Than  
<> - Not Equal  
>= - Greater than or equal  
<= - Less than or equal  
AND - Defines a boolean value that is the AND of two values result = expression1 AND expression2  
OR - Defines a boolean value that is the OR of two values result = expression1 OR expression2  
XOR - Defines a boolean value that is the exclusive OR of two values result = expression1 XOR expression2  
NOT - Defines an opposite boolean value A = NOT B  
EQV - Performs a logical equivalence on two expressions (result is true if both expressions are true) result = expression1 EQV expression2 
IMP - Performs a logical implication on two expressions result = expression1 IMP expression2 
IS - Determines if 2 variables reference the same object result = object1 IS object2 
LIKE - Determines if one string matches a pattern result = string LIKE pattern  
MOD - Returns the integer remainder of a division i = 27 MOD 5  
Math  
VB also provides built-in functions which can act on variables. Most are self-explanatory. In my experience, the VAL, RND, and ROUND functions are among the most valuable, so be sure to pay close attention to them! 
Round - Rounds a number to a selectable number of decimal places result = round ( tempvariable,2 ) 
Val - Returns the numerical content of a string result = Val ("123.4")  
Int - Returns an integer by truncating (different than Fix) i = int ( tempvariable )  
Fix - Returns an integer by truncating (different than Int) i = fix ( tempvariable )  
Hex - Returns the hexadecimal value of any number temp$ = hex ( tempvariable )  
Oct - Returns the octal value of any number temp$ = oct ( tempvariable )  
Tan - Returns the tangent of an angle tempvariable1 = tan ( tempvariable2 )  
Rnd - Returns a random number between 0 and 1 tempvariable1 = rnd  
Randomize - Initializes the Rnd function so it gives different answers each time randomize  
Sgn - Returns the sign of a number i = sgn ( tempvariable )  
Sin - Returns the sine of an angle tempvariable1 = sin ( tempvariable2 )  
Cos - Returns the cosine of an angle tempvariable2 = cos ( tempvariable )  
Abs - Converts a number to a positive value i = abs ( tempvariable )  
Sqr - Returns the square root of a number tempvariable1 = sqr ( tempvariable2 )  
Log - Returns the base 10 logarithm of a number tempvariable1 = log ( tempvariable2 )  
Atn - Returns the arctangent of an angle tempvariable1 = atn ( tempvariable )  
Partition - Sort of an oddball function but segregates values according to ranges  
Type Conversions - A variety of conversion functions  
CBool, CByte, CCur, CDate, CDbl, CDec, CInt, CLng, CSng, CStr, CVar 
Strings  
In my experience these functions are used more than just about any of the other VB built-in functions. The FORMAT, MID, and INSTR functions are incredibly powerful and I use them extensively. If you don't understand what they are, they are worth the time to figure out! The LEN and CHR functions are also valuable as are the variations on the trim and case functions. 
Left - Returns the left n characters of a string temp$ = left$ ( teststring$, 4 )  
Right - Returns the right n characters of a string temp$ = right$ ( teststring$, 4 )  
Trim - Removes leading and trailing spaces of a string temp$ = trim$ ( teststring$ )  
LTrim - Removes only the leading spaces of a string temp$ = ltrim$ ( teststring$ )  
RTrim - Removes only the trailing spaces of a string temp$ = rtrim$ ( teststring$ )  
UCase - Makes all characters upper case temp$ = ucase$ ( teststring$ )  
LCase - Makes all characters lower case temp$ = lcase$ ( teststring$ )  
Mid - Returns n characters from a string, starting a any position temp$ = mid$ ( teststring$, 1, 4 )  
Len - Returns the length of a string (how many characters it has) temp$ = len ( teststring$ )  
LSet - Positions a string inside another, flush to the left temp$ = lrset ( teststring$ )  
RSet - Positions a string inside another, flush to the right temp$ = rset$ ( teststring$ )  
Format - Returns a string formatted according to a user-defined format temp$ = format$ ( teststring$, "####.0" )  
String - temp$ = left$ ( teststring$, 4 )  
Chr - Returns the string representation of a number temp$ = str$ ( 32 )  
Asc - Returns the ASCII code of a single character temp$ = asc ( "A" ) 
Space - Returns n spaces temp$ = space$ ( 15 )  
Instr - Determines if one string is found within a second string i = Instr (starthere, string1, string2)  
InStrRev - Determine if one string is found in a second, starting at the end i = InStrRev (string1, string2, start) 
StrComp - Compares two strings result = StrComp (string1, string2) 
StrConv - Converts the case of a string's characters StrConv (string, vbuppercase)  
StrReverse - Reverses character order in a string StrReverse (string1)  
Replace - Replaces each occurrence of a string Replace (bigstring, searchstring, replacementstring) 
FormatCurrency - Returns a string using a currency format FormatCurrency(var1, 2)  
FormatDateTime - Returns a date or time expression FormatDateTime("3/2/99",vbShortTime)  
FormatNumber - Returns a number formatted according to a variety of options FormatNumber(var1, 2)  
FormatPerCent - Returns a number formated as a percent FormatPerCent(var1, 2) 
Arrays
EnDLeSs is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-01-2007   #2 (permalink)
Noobie
 
Mark's Avatar
 
Join Date: Jul 2007
Location: United States
Posts: 20
Mark is an unknown quantity at this point
Send a message via MSN to Mark
Default

Wow - This are great. Thanks a lot :]
__________________
[SIGPIC][/SIGPIC]
Mark is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-10-2007   #3 (permalink)
Noobie
 
meichien666's Avatar
 
Join Date: Aug 2007
Posts: 8
meichien666 is an unknown quantity at this point
Send a message via AIM to meichien666
Default

This is really useful for the ones who needs it
meichien666 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-24-2007   #4 (permalink)
Noobie
 
Join Date: Jul 2007
Posts: 31
insomnia is an unknown quantity at this point
Default

i wish i was better @ visual basic :$
never really interested me much
insomnia is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-26-2007   #5 (permalink)
Noobie
 
Join Date: Aug 2007
Posts: 8
Simplicity is an unknown quantity at this point
Default

How about & and %.. what are those?
Simplicity is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-02-2007   #6 (permalink)
Noobie
 
Join Date: Sep 2007
Posts: 2
whitehunter is an unknown quantity at this point
Default

So good Topic!
whitehunter is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-12-2008   #7 (permalink)
Noobie
 
Join Date: May 2008
Posts: 4
kothet is an unknown quantity at this point
Default

thz a lot
kothet is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-13-2008   #8 (permalink)
Mod
 
Join Date: Aug 2007
Posts: 35
bumk1d is an unknown quantity at this point
Send a message via MSN to bumk1d Send a message via Yahoo to bumk1d
Default

nice great post
__________________
BuMk1d
bumk1d is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-24-2008   #9 (permalink)
Member
 
e3sarcom's Avatar
 
Join Date: Aug 2007
Location: Jordan
Posts: 50
e3sarcom is an unknown quantity at this point
Send a message via MSN to e3sarcom Send a message via Yahoo to e3sarcom
Default

Very very nice ! Thank you so much ...
__________________
Nice Domains For Sale
http://e3sarcom.com/dom.php
7je.net -- 0pa.net -- 7rv.net -- m8w.com -- upz.me
e3sarcom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -4. The time now is 05:11 PM.
Copyright TalkWarez.com © 2006-2008 - All rights reserved.
TalkWarez.com does not host ANY software! This site merely indexes other sites' contents.