Skip to main content
Participant
April 16, 2009
Question

Possible to concatenate variables?

  • April 16, 2009
  • 2 replies
  • 1952 views

Hi  guys

I wonder if anybody Captivate wizards out there can help me

My aim is simple in principle, but I've been pulling my hair out trying to get it to work.

I'm using the certificate widget, which requires a variable 'v_Name' to fill in the name on the certificate.

However, I also want separate variables for first and lastname so I have more flexibility e.g. 'Well done John!' etc

Here's what I tried:

TEB 1 - obtains a variable 'firstname' (for this example pretend it's John)

TEB 2 - obtains a varialbe 'lastname' (for this example pretent it's Smith)

Before my quiz, I have a 'are you sure you want to continue?' slide.

In the 'Yes' button I have embedded an advanced action:

v_Name = fname + sname

Go to next slide

Of course, when this is done the certificate at the end reads 'JohnSmith'

The advanced action dialog only allows you to add two variables so it's not like I could add firstname + 'space' + lastname.

To get around this i created another variable called 'fnamespace'

fname value is set to $$fname$$ + " "

I then sneakily tried to amend my advance action to:

v_Name = fnamespace + sname

Go to next slide

In the certificate, this returns '$$fname$$ + " "Smith

So my long winded question is, does Captivate understand spaces - is this possible? Because at the moment, it takes things literally and doesn't understand I'm trying to add a space. I've previously done something similar in Excel which works perfectly.

Many thanks in advance for any help.

-Ian

This topic has been closed for replies.

2 replies

Julie88
Inspiring
July 13, 2010

I have had similar issues with the space value.  I was trying to concatenate slide names

to simulate a breadcrumb across the top of a slide.  But I wanted the slide names separated by a space.

Since I was using the slide labels to do this I finally added a space to the label name to accomplish this, but that is not a great solution.  Has anyone else come up with something better?  And is Adobe going to address this?  This seems to be a basic thing.

Thanks!

Participating Frequently
November 3, 2010

OK, so how about this...

Can you concatenate variables to be assigned as the value of another variable?

v_Name = v_fName + v_lName

I have a flash component that assigns the v_Name variable to the completion certificate.

I'd like to be able to call the person by first name within the course, but as it stands, they would have to enter their first name, then their full name to set these variables.

Any ideas?
Kymm

Steve Howard, ACP
Inspiring
April 16, 2009

Try

v_Name = fname + " " + sname

or create your 'space' variable, then use

v_Name = fname + space + sname

Steve

newham12Author
Participant
April 16, 2009

Hi Steve

Thanks for the reply - so close!

I tried creating the space variable - I assigned the value by pressing my spacebar. However, Captivate seems to interpret a space as a value of '0'.

I now get John0Smith showing in the certificate.

As for fname + " " + sname, captivate also seems to interpret " " as a 0

The same goes for when I try to set the value for the variable 'space' to " "

Any other ideas would be appreciated - I've tried pretty much all combinations I can think of.

Regards,

Ian

newham12Author
Participant
April 16, 2009

In case anybody is interested, I have figured a workaround for this:

It doesn't seem possible to set a space by itself as a variable.

So for the second TEB for lastname, I went to options and inserted a space in the 'default text' field. I then made sure that 'retain text' was checked.

This results in a lastname variable which already has a space at the beginning.

Then, it's a simply matter of setting v_Name = firstname + lastname !