how to use Compare?
-
What do you want to compare? Objects, strings, numbers, give us a clue!
Dave Please support my CPRepWatcher article in the August competition! Find Me On: Web|Facebook|Twitter|LinkedIn
-
As in ;
Dim a as byte: a = 34; 'I selected byte type as you stated 0-255 in your question
Dim b as byte: b = 20;if a > b then
msgbox("a is greater than b")
elseif a < b then
msgbox("a is less than b")
else
msgbox("a equals b")
end ifYou cannot get any more basic than that! Surely you could have found out how to do that in the docs or on google.
Dave Please support my CPRepWatcher article in the August competition! Find Me On: Web|Facebook|Twitter|LinkedIn
-
As in ;
Dim a as byte: a = 34; 'I selected byte type as you stated 0-255 in your question
Dim b as byte: b = 20;if a > b then
msgbox("a is greater than b")
elseif a < b then
msgbox("a is less than b")
else
msgbox("a equals b")
end ifYou cannot get any more basic than that! Surely you could have found out how to do that in the docs or on google.
Dave Please support my CPRepWatcher article in the August competition! Find Me On: Web|Facebook|Twitter|LinkedIn
-
sorr, probably i made a mistake, i mean how to use "Compare" to compare 2 deccimal values; for example:compare = int(251 and 4)
-
you already asked and got answers two days ago. I suggest you buy and study an introductory book on VB.NET :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
you already asked and got answers two days ago. I suggest you buy and study an introductory book on VB.NET :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
Damn, if I had bothered to check his previous messages I would have seen this, and wouldn't have responded with what I had. I see what he is on about now! *kicks self in @rse*
Dave Please support my CPRepWatcher article in the August competition! Find Me On: Web|Facebook|Twitter|LinkedIn
-
you already asked and got answers two days ago. I suggest you buy and study an introductory book on VB.NET :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
thanks sir, i knew this point, but that answer is not what i want. i just want to know after compare..what is result? the result is greater value or less value? i searched online and asked someone already. so still couldn't find solution.
the result of a comparison is a boolean value, i.e. either true or false, and not a number nor anything else. Now do yourself a favor: go buy a book and study. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
the result of a comparison is a boolean value, i.e. either true or false, and not a number nor anything else. Now do yourself a favor: go buy a book and study. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
hahahahaha, i think you also need to buy this book to study hard, although my ability in vb6 is really limited, but i don't agree compare can only get boolen.
Actually, YOU do need to buy a book and study something called "binary math". Camparing something is usually a boolean result. But, in your simple example "compare = int(200 and 4)" this results in a binary AND operation on two values, resulting in a third value that is assigned to a variable called "compare".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak