473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Register Program

I am Currently making a program so i can enter a name
eg
Joe Bloggs
and switch the names around
eg
Bloggs Jow

Any ideas how to do this i am stuck
I have started of by inputing the name then finding the space.
were do i go from hear or i am i completly on the wrong track

Private Sub cmdSwitch_Click()

namein = txtNameIn

spacepos = InStr(namein, " ")



End Sub
Oct 10 '06 #1
2 1255
Take a look at the Split Function
Oct 11 '06 #2
willakawill
1,646 1GB
I am Currently making a program so i can enter a name
eg
Joe Bloggs
and switch the names around
eg
Bloggs Jow

Any ideas how to do this i am stuck
I have started of by inputing the name then finding the space.
were do i go from hear or i am i completly on the wrong track

Private Sub cmdSwitch_Click()

namein = txtNameIn

spacepos = InStr(namein, " ")



End Sub
This will work and will help you to understand string functions:

Dim stTitle As String
Dim stFirst As String
Dim stLast As String

'assign the original string
stTitle = "John Smith"

'assign the left part of the string up to the last character before the space
stFirst = Left(stTitle, InStr(stTitle, " ") - 1)

'assign the right part of the string after the space
stLast = Right(stTitle, Len(stTitle) - InStr(stTitle, " "))

'swap the strings around
stTitle = stLast & " " & stFirst

'see what it looks like
MsgBox stTitle
Oct 11 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Alex | last post by:
I apoligise in advance if this is an os or platform based question, I don't know. I was wondering how register integers (and other types of register variables) are managed by c++. For example,...
0
by: Marcel - IDUG Europe 2005 | last post by:
Hi DB2 users, ========================================================================================= We just created a blog dedicated to our upcoming IDUG 2005 Europe Conference (24-28...
16
by: alakesh.haloi | last post by:
Hi All Is there a limit on the number of register variables that can be declared and initialized in a C program on a particular hardware platform? If you define more number of register variables...
16
by: junky_fellow | last post by:
what is the purpose of declaring a register variable ? why can't we find the address of register variable ?
33
by: Snis Pilbor | last post by:
With the "as if" rule in play, doesn't that effectively render the "register" keyword completely useless? Example: I make a silly compiler which creates code that goes out of its way to take a...
5
by: prouleau001 | last post by:
Hi all! Since that the decorator syntax is upon us, I think it would be good if atexit.register() was returning the function passed as argument. This simple change to the library would solve a...
26
by: Vashna | last post by:
Hi Group, I have a doubt about register variables. I know that if we have a variable used very frequently in a function, then provided we never apply the & function to it, we can define it as...
5
by: muppetjones | last post by:
I'm really new to the whole networking side of things, so I don't know the backend very well. I wrote a series of PHP/AJAX scripts to allow a user to create a login account, but apparently my script...
65
by: Spiros Bousbouras | last post by:
Has anyone found that declaring variables register affected speed of execution ? If yes on what hardware and around which year ?
7
by: RANNA | last post by:
Say the CPU has only AL, BL, CL, DL or eight 8 bit registers, and if want to declare 10 register variables in my code, is it possible to do it?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.