[ic] How to assign a scratch variable to a VBScript Variable??
interchange at tvcables.co.uk
interchange at tvcables.co.uk
Sat Dec 4 10:40:15 EST 2004
Quoting Stefan Hornburg <racke at linuxia.de>:
> interchange at tvcables.co.uk wrote:
> > Quoting interchange at tvcables.co.uk:
> >
> >
> >>Quoting Joachim Leidinger <info at ebusiness-leidinger.de>:
> >>
> >>
> >>>interchange at tvcables.co.uk wrote:
> >>>....
> >>>
> >>>>I set a scratch variable on my admin_view page, this works just fine and
> >>>
> >>I
> >>
> >>>can
> >>>
> >>>>display the varible on the screen ok, so I know its been set.
> >>>>
> >>>
> >>>Try
> >>>
> >>>
> >>>>[set myname]
> >>>
> >>>[seti myname]
> >>>
> >>>
> >>>>[loop-calc]
> >>>
> >>>...
> >>>
> >>>>[/loop-calc]
> >>>>[/set]
> >>>
> >>>[/seti]
> >>>
> >>>
> >>>>[scratch myname] - Display on screen ok!
> >>>>
> >>>>Now I have my scratch variable (myname) I am trying to use its value
> >>>
> >>(text
> >>
> >>>>string) in some vbscript.
> >>>>
> >>>>I am trying to set my vb variable (vbname) to be equal to the value of
> >>>
> >>the
> >>
> >>>>scratch variable (myname), I thought this would work:
> >>>>
> >>>><script language="vbscript">
> >>>>dim vbname
> >>>>vbname = "[scratch myname]"
> >>>
> >>>Make sure [seti myname] first and vb script is using *after* setting the
> >>>myname var.
> >>>
> >>>Hope that helps!
> >>>
> >>>Joachim
> >>
> >>Thanks for the reply, still no joy though, tried [set], [seti] and [tmp]
> none
> >>
> >>make it work. The scratch variable is set immediately before the vbscript.
> >>The
> >>script is ok as I can manually set the vbname, eg vbname="Andy" works fine,
> I
> >>
> >>just cannot get vbname to pick up the value of the scratch variable....
> >>
> >>Any more suggestions please?
> >>
> >
> >
> > I think I may have found the problem, it looks like the scratch variable
> has a
> > carriage return or line feed at the beginning and end of it, can that be
> > removed with an extra perl line? Not very good with perl....
>
> Try [scratch name=myname filter=strip] or [filter op=strip
> interpolate=1][scratch myname][/filter].
>
Thanks Racke, the first one works a treat! All fixed now.
Andy.
More information about the interchange-users
mailing list