Jump to content
Macro Express Forums

Need Assistance Splitting A Name Into 2 Variables


IceBox

Recommended Posts

Hello everyone. I am stuck… I need to copy a full name from one screen and enter it into 2 different fields on another screen. On the first screen, the name is always in the same spot on the screen in the form: FIRST M LAST If there is no middle initial, the form is: FIRST LAST

 

Here is how far I have gotten:

 

I can copy the entire name and then “Right Trim” to account for different name lengths. I then need to split the full name into 2 separate variables, first name and last name. I never need the middle initial. Using the command “Set Integer – Get position of Text in a Text Variable”, I can locate the space between the 2 names, and using that number, the rest is fairly simple to work out. However, when the name includes a middle initial (90% of the time), there are 2 spaces. I am assuming that Macro Express will set the integer variable based on the first space it finds. If that is the case, the first name will be very easy to isolate. But how do I know if the last name starts in the next character spot, or 3 spots over?

 

I sure hope I explained that well. Any help would be greatly appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...