Friday, March 26, 2010

Possible to concatenate variables?

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

Possible to concatenate variables?

Try

v_Name = fname + '' '' + sname

or create your 'space' variable, then use

v_Name = fname + space + sname

Steve

Possible to concatenate variables?

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


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 !

No comments:

Post a Comment