ok, never mind. I will play around a bit and send you a better script.
Original Message:
Sent: 12-30-2023 00:31
From: Malcolm Thorpe
Subject: Parsing Text with Comma
This is the base script I use when I want to manipulate names with commas. This one flips first and last names. But I think that if you delete the bold portion of the script and replace the 1 with 0 (zero) it SHOULD just display the text that appears before the comma. I'm not at my Xpression so I can't really test this one. I'll try tomorrow.
if InStr(text, ",") > 0 then
text = split(text, ",")(1) & " " & split(text, ",")(0)
else
text = text
end if
------------------------------
Malcolm Thorpe
xpression design
Free Lance Xpression Designer/Carbonite TD
Original Message:
Sent: 12-29-2023 16:58
From: Matt Finlayson
Subject: Parsing Text with Comma
There is a recent post about parsing text via scripting. I have a similar question, but my issue is a bit different. I am pulling a name from datalinq.
Ex. STEWART,TREY
Here is the script I am using on the text object to delete the first name and just show the last name:
dim list(3) as string
'Check for a comma
if( InStr(text,",") > 0) then
list = split(text,",",2)
text = ltrim(list(0))
else
list = split(text," ",2)
text = ltrim(list(1))
end if
This script works fine for all names except for this one:
ADAMS JR.,MARCUS
I want the text object to read "ADAMS JR." and that is what shows in the preview window. But when I take the scene online, the text object reads "JR." only.
Any thoughts?
------------------------------
Matt Finlayson
Brigham Young University
------------------------------