msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Between Keyword

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
Haider Shah



Joined: 04 Oct 2007
Posts: 3

PostPosted: Wed Dec 27, 2006 1:12 am    Post subject: Between Keyword Reply with quote

Hi i am using vb6, so any body inform me the following statment.
If (x >= Shape1.Left And _
x <= Shape1.Left + Shape1.Width And _
Between(y, Shape1.Top - 50, Shape1.Top + 50)) Or _
(y >= Shape1.Top And _
y <= Shape1.Top + Shape1.Height And _
Between(x, Shape1.Left - 50, Shape1.Left + 50)) Then
But the error that the "Between" keyword sub or function not defined.
is there "Between" keyword doesnt exist.
waiting for your soon reply,
Thanks.
Best Regards.
Haider

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1325

PostPosted: Tue Dec 26, 2006 12:46 pm    Post subject: Re: Between Keyword Reply with quote

"Haider Shah" wrote in message@TK2MSFTNGP04.phx.gbl
> Hi i am using vb6, so any body inform me the following statment.
> If (x >= Shape1.Left And _
> x <= Shape1.Left + Shape1.Width And _
> Between(y, Shape1.Top - 50, Shape1.Top + 50)) Or _
> (y >= Shape1.Top And _
> y <= Shape1.Top + Shape1.Height And _
> Between(x, Shape1.Left - 50, Shape1.Left + 50)) Then
> But the error that the "Between" keyword sub or function not defined.
> is there "Between" keyword doesnt exist.

That's correct. VB has no 'Between' keyword. You can create your own
function if you want...

Public Function Between(ByVal TheVal As Single,ByVal LowVal As Single, _
ByVal HiVal As Single) As Boolean
Between=(TheVal>=LowVal And TheVal<=HiVal)
End Function

If (Between(x,Shape1.Left,Shape1.Left + Shape1.Width) _
And Between(y, Shape1.Top - 50, Shape1.Top + 50)) _
Or (Between(y,Shape1.Top,Shape1.Top + Shape1.Height) _
And Between(x, Shape1.Left - 50, Shape1.Left + 50)) Then

Or you can rewrite the original to test all the ranges directly

If (x >= Shape1.Left And x <= Shape1.Left + Shape1.Width _
And y>=Shape1.Top - 50 and y<=Shape1.Top + 50) _
Or (y >= Shape1.Top And y <= Shape1.Top + Shape1.Height _
And x>=Shape1.Left - 50 and x<=Shape1.Left + 50) Then

I'm not sure why you had one part of each test spelled out and the other
relying on there being a 'between' function.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1325

PostPosted: Tue Dec 26, 2006 12:47 pm    Post subject: Re: Between Keyword Reply with quote

"Haider Shah" wrote in message@TK2MSFTNGP04.phx.gbl
> Hi i am using vb6, so any body inform me the following statment.

Just saw that this has been multiposted and answered in multiple places.

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
who could give me a "vb keyword list"? Such as "if... then" or other VB keyword and each keyword's description, I think this is a way to learn VB's syntax, anybody could give me such a list file? thanks:)

Between keyword Hi i am using vb6, so any body inform me the following statment. If (x >= Shape1.Left And _ x <= Shape1.Left + Shape1.Width And _ Between(y, Shape1.Top - 50, Shape1.Top + 50)) Or _ (y >= Shape1.Top And _ y <= Shape1.Top + Shape1.Height And _ Between(x, Sh

Using the keyword Call or not ?? Hi, Can anyone give me a good reason why you should use thekeyword "Call" in front of a function call?? Thanks Soren

Reason for 'Set' keyword Hi. Could someone please explain to me the reason for the 'Set' keyword in VB. Am I correct in thinking that Set is used for assigning to a reference whereas assignment to primitives is done without 'Set'? Why is that? Most other languages just use '='

Split a 100 page doc and taking a keyword off each document I have a 100 page word document that is a mail merge. Each document we will say is a new document and a SSN is located on each doc in the same location. Is there a way to split the documnet in to single pages and create a comma delimented text file like
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group