SunQuest
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old April 15th, 2008, 04:35 AM
acidedge2004 acidedge2004 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 107 acidedge2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 25 m 8 sec
Reputation Power: 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.

Reply With Quote
  #2  
Old April 15th, 2008, 09:09 AM
zynder's Avatar
zynder zynder is offline
Not much of a contributor
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2006
Location: Hidden
Posts: 782 zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)zynder User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 133931 Folding Title: Super Ultimate Folder - Level 1Folding Points: 133931 Folding Title: Super Ultimate Folder - Level 1Folding Points: 133931 Folding Title: Super Ultimate Folder - Level 1Folding Points: 133931 Folding Title: Super Ultimate Folder - Level 1Folding Points: 133931 Folding Title: Super Ultimate Folder - Level 1Folding Points: 133931 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 2 Days 19 h 13 m 58 sec
Reputation Power: 610
Send a message via Yahoo to zynder
Can you post the code before calling that? How did you declare your variables?

Reply With Quote
  #3  
Old April 15th, 2008, 10:41 AM
medialint's Avatar
medialint medialint is offline
spirit duplicator
Click here for more information.
 
Join Date: Apr 2004
Location: \\Firecrate\
Posts: 12,195 medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)medialint User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 230955 Folding Title: Super Ultimate Folder - Level 1Folding Points: 230955 Folding Title: Super Ultimate Folder - Level 1Folding Points: 230955 Folding Title: Super Ultimate Folder - Level 1Folding Points: 230955 Folding Title: Super Ultimate Folder - Level 1Folding Points: 230955 Folding Title: Super Ultimate Folder - Level 1Folding Points: 230955 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 2 Weeks 5 Days 10 h 34 m 36 sec
Reputation Power: 2500
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)

Reply With Quote
  #4  
Old April 15th, 2008, 05:41 PM
acidedge2004 acidedge2004 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 107 acidedge2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 h 25 m 8 sec
Reputation Power: 1
Thumbs up

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Mid and Left functions not recognised!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

IBM developerWorks




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway