Visual Basic Help

  • Xios
  • Student
  • Student
  • User avatar
  • Posts: 77
  • Loc: Saturn

Post 3+ Months Ago

I'm Having Trouble at the moment.
Does anyone know anything about the InSTR inVB6 :?:
I want to know everything that it can do!

I dont know much about it so any help would be greatly appreciated :lol:

Thanx...
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Example,
Code: [ Select ]
Dim IP,banned

'code to fill banned string from XML would go here, using _ delimiter

'get user IP
IP = Request.ServerVariables("REMOTE_ADDR")

'check banned string for current users IP
If InStr(banned, IP) Then
   'kick em out here
Else
   'ban the ip and kick em out anyway here  :twisted:
End If
  1. Dim IP,banned
  2. 'code to fill banned string from XML would go here, using _ delimiter
  3. 'get user IP
  4. IP = Request.ServerVariables("REMOTE_ADDR")
  5. 'check banned string for current users IP
  6. If InStr(banned, IP) Then
  7.    'kick em out here
  8. Else
  9.    'ban the ip and kick em out anyway here  :twisted:
  10. End If


Basically InStr is used to check for a string within a string just as the name implies, IN STRing.
Hope this helps. :D

EDIT: i might as well explain somthing else while im at it.
Code: [ Select ]
If InStr(banned

the first part is the string variable,arraySpace, ect, to be searched, youll probably never use quotes for it, and it usally starts with If.

,IP  OR "192.168.1.100"

the second part can be a variable, arraySpace or a "quoted" static string.
though static strings aren't very practical.

Of course you'll follow that with "Then", define some conditions, maybe some "Else If"s or what not.

As far as I know other than searching a Dynamically built string for "Mini strings" InStr has nothing more to do.
  1. If InStr(banned
  2. the first part is the string variable,arraySpace, ect, to be searched, youll probably never use quotes for it, and it usally starts with If.
  3. ,IP  OR "192.168.1.100"
  4. the second part can be a variable, arraySpace or a "quoted" static string.
  5. though static strings aren't very practical.
  6. Of course you'll follow that with "Then", define some conditions, maybe some "Else If"s or what not.
  7. As far as I know other than searching a Dynamically built string for "Mini strings" InStr has nothing more to do.
  • Lieven
  • Beginner
  • Beginner
  • User avatar
  • Posts: 57
  • Loc: Belgium

Post 3+ Months Ago

If you need microsoft development help -> MSDN

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctinstr.asp

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 151 guests
  • 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 post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.