[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Fri September 18 2009, Peter Wang wrote:
> On 2009-09-18, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> > On Thu September 17 2009, Peter Wang wrote:
> > > My guess is that in preprocess_page.awk, the initial block to load the
> > > prototypes into the array isn't working correctly. Can you try putting
> > > some print commands there to check?
> >
> > I don't speak awk, I took a look, but I'm not sure whats going on, or
> > where I should place the prints.
>
> Here's the annotated version:
>
> # Before executing the rest of the script, do this:
> BEGIN {
> # Assign the value of environment variable `PROTOS' to a variable.
> PROTOS = ENVIRON["PROTOS"]
>
> # Read the next line from the protos file into a variable.
> # Until the end-of-file:
> while ((getline line < PROTOS) > 0) {
> # Split the line into words, treating the string colon-space
> # as a separator.
> split(line, arr, /: /)
>
> # Name the array elements.
> name = arr[1]
> text = arr[2]
>
> # Append the new text to whatever text already is in the
> # array for the given entry.
> protos[name] = protos[name] "\n " text
> }
>
> # Close the file.
> close(PROTOS)
> }
>
> > > Also, which version of awk are you using?
> >
> > apt-show-versions says: mawk/stable uptodate 1.3.3-11.1
> >
> > mawk itself doesn't seem to have a way to ask it to show its version.
>
> I've tested with the same version.
I've tried putting a print in that main loop, it just causes mawk to hang
somehow.
> Peter
>
> ---------------------------------------------------------------------------
> --- Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register
> now! http://p.sf.net/sfu/devconf
>
--
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx