I did this kind of application too. There is one little thing that you need to be careful about when using @pad. In the case where you might need to have a blank filled region, it might be tempting to use the pad command in the following way:
<@pad str="" char=" " numchars=8>
if you wanted 8 blanks. However, this will give you 7 blanks. You need to use the following syntax to get 8 blanks:
<@pad str=" " char=" " numchars=8>
The difference is that str=" " instead of str="". I don't know if this is a bug or not, but it took me a while to find the problem.
Stefan
At 09:25 AM 3/6/2003 -0700, you wrote:
Hi Gene,
I shouldn't think it would too hard. If I follow you, you need a string of a known length - but have to populate the string with some particular bits of data?
You could prepare a string, like the following, with markers (of known length) - then use <@REPLACE> to substitute the markers with your data:
AAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCDDDDDDDDDDDDDDD
......................... Legend A = User ID B = First name C = Last name D = Title
Another Metatag to use in conjunction with <@REPLACE> would be <@PAD> - available in SP1 or higher. Which can provide whatever filler character to use around the data.
>From the "Whats_new.PDF".
<@PAD>
Syntax <@PAD STR=string NUMCHARS=padToLength [CHAR=padcharacter] [POSITION=BEFORE|AFTER] [ENCODING=encoding]> Description The <@PAD> meta tag returns an input string expanded to a specified length by prefixing or appending a given character as many times as necessary. It can be used to construct values to be passed to a function that expects fixed length data or to build up a table or other preformatted text for display in a monospaced font. The STR attribute specifies the string to be padded. The NUMCHARS attribute specifies the length to which the string is padded. If the specified string to be padded (STR) is longer than the length specified in NUMCHARS, the original string is returned. The CHAR attribute specifies the character to use to pad the string. If more than one character is specified here, only the first character is used. If the CHAR attribute is absent, the space character is used to pad the string. The POSITION attribute is optional, and indicates whether to pad the beginning (BEFORE) or end (AFTER) of the string. The default is AFTER. All attributes of <@PAD> may contain meta tags.
Example <@PAD STR="alpha" CHAR="x" NUMCHARS="8" POSITION="after">
This example returns "alphaxxx"; that is "alpha" followed by three "x" characters.
Hope this helps. Cheers........
Scott Cadillac, Witango.org - http://witango.org 403-281-6090 - [EMAIL PROTECTED] -- Information for the Witango Developer Community ---------------------
XML-Extranet - http://xml-extra.net 403-281-6090 - [EMAIL PROTECTED] -- Well-formed Development (for hire) ---------------------
----- Original Message ----- From: "Wolf, Gene" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 06, 2003 8:53 AM Subject: Witango-Talk: Help with Strings
> OK, I've just run into somethng that I have not seen before, and not seen > addressed here. I'm hoping that someone here has come up with something > similar. > > I'm writing a program to interface with an OLD DOS type system. The > interface requires a series of import records of exactly 252 bytes in > length. In this record specific data items like, employee number, shift, > date, etc., have specific columns into which they must be placed and have > specific lengths. > > What I'd like to do is create a record of 252 bytes, then "substring" into > those locations the data for each employee and then write that record and do > the same for the next employee record. Unfortunately substring doesn't work > this way and I can't figure out how to make this happen. I suppose I could > build this string field by field, and may be reduced to doing that, but I > thought there may be a better way. > > Anyone have any ideas? > > Sincerely, > Gene Wolf > Business Systems Analyst > DRS Optronics, Inc. > 2330 Commerce Park Drive > Palm Bay, Florida 32905 > Phone: 321-309-0685 > E-mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > ________________________________________________________________________ > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > with unsubscribe witango-talk in the message body
________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
========================================================
Database WebWorks: Dynamic web sites through database integration
http://www.DatabaseWebWorks.com
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body
