Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > question


Reply
 
Thread Tools Display Modes
  #1  
Old 08-23-2002, 02:01 PM
sandy78 sandy78 is offline
Centurion
 
Join Date: Jul 2002
Posts: 96
Default question


is this right, what i am doing ??


dim textval as integer

textval = txtedit.selstart - 1

if textval < -1 then (i am put some logic over here)

suppose the txtedit.selstart = 0

then textval = 0 - 1

then it should get -1, but it is never getting that -1

why ??

can someone please tell me, what is wrong ??
Reply With Quote
  #2  
Old 08-23-2002, 02:03 PM
Nymble
Guest
 
Posts: n/a
Default

if textval < -1 then (i am put some logic over here)

that mean if and only if txtval is = to -2, -3, -4, -5, -6.... etc....
Reply With Quote
  #3  
Old 08-23-2002, 02:04 PM
Nymble
Guest
 
Posts: n/a
Default

then it should get -1, but it is never getting that -1

actually that why it never get to -1...

try something like

if textval = -1 then
or
if textval < 0 then
Reply With Quote
  #4  
Old 08-23-2002, 02:05 PM
Mathimagics's Avatar
Mathimagics Mathimagics is offline
Algorithms 'R' Us

Forum Leader
* Guru *
 
Join Date: Jun 2002
Location: Canberra
Posts: 4,123
Default

Hmmmm... methinks expression -1 < -1 be False.... try if textval < 0 .....

Dr Memory
__________________
Sept, 2006: 2 ^ 232,582,657 - 1 is prime!

At first, I was iridescent. Then, I became transparent. Finally, I was absent.
Reply With Quote
  #5  
Old 08-23-2002, 02:06 PM
Mathimagics's Avatar
Mathimagics Mathimagics is offline
Algorithms 'R' Us

Forum Leader
* Guru *
 
Join Date: Jun 2002
Location: Canberra
Posts: 4,123
Default

The verdict is unanimous!
__________________
Sept, 2006: 2 ^ 232,582,657 - 1 is prime!

At first, I was iridescent. Then, I became transparent. Finally, I was absent.
Reply With Quote
  #6  
Old 08-23-2002, 02:15 PM
MarkVB6's Avatar
MarkVB6 MarkVB6 is offline
Centurion
 
Join Date: Aug 2002
Location: Ontario, Canada
Posts: 170
Default

Actually if then if you had -0.5, it would show up. Try <= -1 for the best result.

The verdict is no longer unanimous...:O
__________________
A silly idea is current that good people do not know what temptation means. This is an obvious lie. Only those who try to resist temptation know how strong it is... A man who gives in to temptation after five minutes simply does not know what it would have been like an hour later. That is why bad people, in one sense, know very little about badness. They have lived a sheltered life by always giving in. -C.S. Lewis
Reply With Quote
Reply


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 Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->