[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Memory problems?
- Subject: Re: Memory problems?
- From: Harry Binswanger hb@xxxxxxxx
- Date: Sun, 08 Sep 2002 17:31:53 -0400
Carl,
TEST.TXT wasn't attached, but it's clear without even seeing it that
you're breaking the memory bank.
Yep, your test showed it.
In my experience, anything larger than 4 or 5K
is iffy, depending on current memory usage.
I'm surprised. I thought there was 64k available.
... that subsequent func RD isn't healthy;
Oh, didn't know that either. I'll use DN per your suggestion in all my
programs.
You need a workaround. Since I don't know what your ultimate use
for this procedure is, I can't say for sure what would be
appropriate.
I'm taking a Eudora address book (alias file) and trying to expand the
aliases, which are nested about 3 levels deep, to get the ultimate email
addresses. The structure is as below:
alias toplevel 1,2,3,4,5,6,7,
alias 1 foo,bar,zlits
alias foo Mr. Foo
and each of the other aliases under a (2,3,4 ...) and the other aliases at
the second level (bar & zlits) have their own expansions.
So the final result should be the full expansion of alias "toplevel" into a
list of nothing but email addresses, separated by commas. The list would be
about 600 addresses long.
(Unfortunately, the exact syntax for the lowest level can vary, which
creates a hell of a problem, but that isn't my concern now.)
I was trying to do all the processing with XS, parsing out what's between
commas at each level, searching for its alias-definition, then building an
output string. I figured that it should all be done in memory, rather than
putting stuff in an alternate window and pushing it around "physically."
Apparently, that's what I *must* do.
In (blush) XyBasic, here's what the offending loop was primary$ having been
defined, in the part not shown, to be the equivalent of the 1,2,3,4,5,6,7,
The translation you need is only that the apostrophe signals a function
(e.g., 'bc) and that "comx" invokes a BX...Q2 pair.
primary$ = "1,2,3,4,5,6,7,"
primary.loop.start:
if primary$ = null$ then goto out.primary.loop ; have parsed to end of
primary$
parse primary$, comma$, head$, dummy$, tail$ ; this is XS
primary$ = tail$ ; lop off the part will have expanded in next lines
comx "se/t /alias " head$ " /" ; find the expansion of this alias
if error then 'bc print "can't find " head$ : stop
'df 'np 'cl 'df ; define content of expansion of alias, up to newline
char.
work$ = savedef$ ; store it
'xd
secondary$ = secondary$ + work$ ; *** Memory problems hit here
head$ = null$ : tail$ = null$ ;
goto primary.loop.start
out.primary.loop:
I was intending to write it first as a series of loops (primary, secondary,
maybe tertiary), then when I got it to work, make it one recursive loop.
Comments welcomed.
--Harry
Harry Binswanger
hb@xxxxxxxx