[ic] counter tag question

Mike Heins interchange-users@icdevgroup.org
Wed Aug 14 13:14:02 2002


Quoting Dennis Chen (dchen@technicacorp.com):
> Hi all,
> 
> I've read through the docs and mailing list but guess nobody had this issue.
> Is there a way to allow the [counter] tag read special characters from file?
> ie.  PO-0200012 because as of current, the "-" or any other special
> characters
> don't work.  Having PO0200012 will definitely confuse people and I don't
> want
> to have PURCHASE0200012 as the PO number as it is too long.  
> I have found the CounterFile.pm but don't know what to change.  
> 
> Help anyone??

No, you can't do it.

But making a global usertag called "my-counter" would be dead simple.

UserTag my-counter             Order        file
UserTag my-counter             addAttr
UserTag my-counter             attrAlias    name file
UserTag my-counter             InvalidateCache
UserTag my-counter             PosNumber    1
UserTag my-counter             Routine <<EOR
sub {
	my $value = $Tag->counter(@_);
	$value =~ s/([A-Za-z])(\d)/$1-$2/;
	return $value;
}
EOR

That will add a dash at the first letter/number boundary.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

I don't want to get to the end of my life and find I have just
lived the length of it. I want to have lived the width of it as
well. -- Diane Ackerman