[ic] scratch values and usertags question

Ed LaFrance edl at newmediaems.com
Wed Oct 8 16:38:07 EDT 2003


At 10:52 AM 10/9/2003 +1300, you wrote:


> > Q? How do I get the "[" characters to be preserved during the write
> > operation? At the moment they are turned into #&91; I did try
> > simply writing
> > the field to the file but then I lost the "<" and "["
> > characters completely.
> >
>
>I've sorted out how to do this, but I'd like to know if there are more
>efficient ways to do this with IC. It seems a bit long winded to me.
>
>Cheers Matthew :)

Perhaps I am misunderstanding your intent, but is there any reason you are 
not using the [log] tag without the interpolate=1 parameter to accomplish this?

- Ed L.



>#### HTML ####
>[save2file filename="filename" filedata="unsafe data with [ and < characters
>in it....."]
>
>This could also easily be modified to be a [save2file filename=""]unsafe
>data in here....[/save2file] pair.
>
>I had to change permissions of directory and file. The IC user needs to have
>write permission to the directory and file.
>
>This is the usertag I used to do the write of the file.
>
>#### USERTAG ####
>UserTag save2file Order filename filedata
>UserTag save2file addAttr
>UserTag save2file Documentation <<EOF
>
>=pod
>This tag uses the open/syswrite/close functions to write some data to a
>file.
>Options:
>                 filename
>                 data
>Example:    [save2file filename filedata]
>=cut
>EOF
>
>UserTag save2file Routine <<EOR
>sub {
>         my ($filename, $filedata) = @_;
>
>         open(UPLOAD, ">$filename") or die "$filename could not be opened for
>writing.\n";
>         $filedata=~s/\&\#91\;/\[/g;
>         syswrite UPLOAD, $filedata;
>         close(UPLOAD);
>         return;
>     }
>EOR
>#### END ####
>
>
>Also, I've written a tag to get data from a database which was returned in
>safe mode, then parse it to return the [ characters so it can be
>interpolated in a scratch variable. Again there must be a more straight
>forward way of doing this with IC.....anyone?
>
>#### HTML ####
>[seti variable][unsafe strdata='[sql-param ..parameter..]'][/seti][seti
>content][scratch name=content interpolate=1][/seti]
>
>#### USERTAG ####
>UserTag unsafe Order strdata
>UserTag unsafe addAttr
>UserTag unsafe Documentation <<EOF
>
>=pod
>Options:        strdata
>Example:    [unsafe strdata]
>=cut
>
>EOF
>
>UserTag unsafe Routine <<EOR
>sub {
>         my ($strdata) = @_;
>
>         $strdata=~s/\&\#91\;/\[/g;
>         return "$strdata";
>     }
>EOR
>
>_______________________________________________
>interchange-users mailing list
>interchange-users at icdevgroup.org
>http://www.icdevgroup.org/mailman/listinfo/interchange-users

===============================================================
New Media E.M.S.              Technology Solutions for Business
11630 Fair Oaks Blvd., #250   eCommerce | Consulting | Hosting
Fair Oaks, CA  95628          edl at newmediaems.com
(916) 961-0446                http://www.newmediaems.com
(866) 519-4680 Toll-Free      (916) 961-0447 Fax
=============================================================== 



More information about the interchange-users mailing list