Link to home
Start Free TrialLog in
Avatar of usky1
usky1

asked on

Add to cfset

I have two variables simg & limg.
I also have a variable pnum.
How do I do a cfset for the following,
<cfset simg = #pnum# -1>
<cfset limg = #pnum# -2>
So if pnum = 1234, simg would equal 1234-1 and limg would equal 1234-2
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
im not really sure what you're asking because your code is right as far as setting variables up together, you just need to add

<cfset pnum = 1234>
before you do
<cfset simg = #pnum# -1>
<cfset limg = #pnum# -2>

do you need to display the result?
if so, just do
<cfoutput>
simg is equal to #simg# <br>
limg is equal to #limg# <br>
</cfoutput>
or like this:

<cfset simg = pnum & "-1">
<cfset limg = pnum & "-2">
Avatar of usky1
usky1

ASKER

Thanks for your quick help on this.