I think this is an essential method, and someone should probably make
a feature request. Since going over to php, I can't tell you how
often I use serialize, and unserialize to store data for later usage.
You can take any array, just store to disk or a db table. Using Char
28 and 30 is about as safe as you can get, but witango should have an
internal method/tag for this. Its invaluable.
--
Robert Garcia
President - BigHead Technology
VP Application Development - eventpix.com
13653 West Park Dr
Magalia, Ca 95954
ph: 530.645.4040 x222 fax: 530.645.4040
[EMAIL PROTECTED] - [EMAIL PROTECTED]
http://bighead.net/ - http://eventpix.com/
On May 7, 2007, at 7:25 AM, Dale Graham wrote:
<pre>
I write these out using this snippet (gotten long ago from the
WitangoTalk list). Note that I write them in with <@char 28> and
<@char 30> (the truly useful array characters - another prior
discussion) so these must be read in this way as well.
(I use these delimiters in case other characters (tabs, returns,
commas, semi-colons) appear in the data, which can really foul you
up.)
So the write looks like this
<@ASSIGN name="request$Count" value="<@NUMCOLS ARRAY='[ARRAY SCOPE,
NAME GOES HERE]'>">
<@ROWS ARRAY='[ARRAY SCOPE, NAME GOES HERE]'>
<@COLS><@COL encoding="none"><@IF EXPR=" '<@CURCOL>' < '<@VAR
NAME=request$Count>' "
TRUE="<@CHAR 28>" FALSE="<@CHAR 30>"></@COLS></@ROWS>
And the read back in looks like this
(Assumes you have called the read in file contents "filecontents"
in request scope)
<@assign name="request$thisdata" value="<@array value='request
$filecontents' cdelim='<@char 28>' rdelim='<@char 30>'>">
If you DO want to use tabs and returns, substitute <@char 9> and
<@char 10> (or <@char 13>, depending on the system) 9 = tab, 10
(or 13) = return.
</pre>
On May 7, 2007, at 7:06 AM, Wayne Irvine wrote:
I am generating an array from a search action and writing it to a
file.
I then wish to retrieve it later an use and an array.
When I write it to a file it is written as a HTML table.
When I read it back from the file it is a single var containing
the HTML
table and data.
Can I specify a more relevant format for saving the array (tab
delimited?).
How do I read it back and interpret it as an array?
Wayne Irvine.
Byte Services Pty Ltd
http://www.byteserve.com.au/
[EMAIL PROTECTED]
Ph 02 9960 6099 Mob 0409 960 609 Fax 02 9960 6088
_____________________________________________________________________
___
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
______________________________________________________________________
__
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf