• Welcome to Valhalla Legends Archive.
 

I dunno whats wrong =(

Started by Dyndrilliac, October 19, 2003, 01:46 PM

Previous topic - Next topic

Dyndrilliac

If InStr(Ver) <> 0 Then
   MsgBox "Error while checking version. Version check not passed, but you are allowed to proceed.", vbInformation, "Error"
   Ver = App.Major & "." & App.Minor & "." & App.Revision
   NewsS = "Server Temporarily Unavailable"
End If
If Ver <> App.Major & "." & App.Minor & "." & App.Revision Then
  MsgBox " It has been detected you are running an old version of this bot. Please check for updates."
  NewVersion
End If
If Form5.Text1.text <> KeyBC Then
  MsgBox " You have entered an invalid SmartBot KeyCode. This program will now close, as unauthorized personel have been detected."
  Form5.Text1.text = vbNullString
  End
Else
  MsgBox " You have entered a valid SmartBot KeyCode. Welcome to " & App.ProductName & " v" & Ver & "."
  Form5.Text1.text = vbNullString
  Unload Form5
End If


It errors saying something about needing a list seperator @ InStr(Ver)

Any Clues would be appreciated.
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

CupHead

Clue: Instr takes more than one argument.

Dyndrilliac

#2
An example would be nice?  :P

EDIT:

You mean like this?
If InStr(Ver, App.Major & "." & App.Minor & "." & App.Revision) <> 0 Then
Quote from: Edsger W. DijkstraIt is practically impossible to teach good programming to students that have had a prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

Soul Taker

I believe the params are InStr(<point to start searching from>, <string to search in>, <string to search for>)

Banana fanna fo fanna


Soul Taker

All of them seem to be optional.

bmwrb16

#6
Dim strHi As String
   strHi = "Hi, my name is Brian!"
   
' Having InStr(strHi, "Hi") not =, <>, >, < anything is the same thing as InStr(strHi, "Hi") <> 0; InStr is a function so it returns an integer of the position where it was found, 0 = not found and any other integer means it did find it and thats the position. '

   If InStr(strHi, "Hi") Then ' We're Going to search through string 'strHi' for string "Hi". '
       MsgBox "InStr is fun!" ' If found create a message box containing "InStr is fun!". '
   End If
   
' Note: InStr is also case sensitive so to eliminate that problem just put InStr(LCase$(String1), LCase$(String2)) or UCase$(). '


Like St0rm.iD said that start index is optional so you just put the string your searching and then what you want to find, like in the above example (Just check the arguments that the function is asking for if your not sure!).

Hope this helps or teaches someone something new!

PS.

Lol yes Soul Taker they all seem to be optional, but theres a default for each one.

Banana fanna fo fanna

bmwrb +1 for actually reading something I wrote :)