|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Mid and Left functions not recognised!
I am trying to use Mid and Left Functions on a string. I have checked online on various sites, including W3Schools, so I know they are the correct functions. However, when I try to run the script in command prompt I get error messages saying that it does not recognise Mid and Left functions. Anyone know why?
Code:
ForeNames = Mid(strUserName,1,instr(strUserName, ",")-1) Surname = Mid(strUserName,instr(strUserName, ",") + 1,Len(strUserName) - 1 ForeNames = Left(strUserName, instr(strUserName, ",") - 1) The aim is to basically retrieve everything before the comma for Forenames, and everything after the comma for Surname.Here I put the two appraches I tried for getting the forename but neither is recognised. |
|
#2
|
||||
|
||||
|
Can you post the code before calling that? How did you declare your variables?
|
|
#3
|
||||
|
||||
|
This is a compatibility bug. Please post the exact error message and number and I can track this down on MSDN for you I've seen this before ...
Please also cite your exact platform (and SP level) and what is included in your project references. The fix is simple but you need to be very exacting for me to help to dig it out
__________________
medialint.com "Energy has the opportunity to change the climate if it's done right." - Sen. John Ensign, R-Nev. (quoted out of context) |
|
#4
|
|||
|
|||
|
Thanks for the reply. I have got the problem sorted now, some what at work took my laptop away and sorted it out. Probably did what you did!!! Thanks for trying though, always appreciated http://images.devshed.com/fds/icons/icon14.gif
Thumbs up |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Mid and Left functions not recognised! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|