MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: Minivend 3.12 is on drugs?



On Jul 7, 11:14pm, Steve Cockwell wrote:
> Subject: Minivend 3.12 is on drugs?
> ******    message to minivend-users from Steve Cockwell
<stevec@sierra.lazarus.ca>     ******
>
> Please explain the following:
>
> 1.  The code segment:
>
> [tag each test]
> [sort test:foo]

If foo is the first field of test.asc, try [sort test:0]
>From the docs:
[sort][/sort]
  The field options passed in either numeric or field name
  form. If they are field numbers, they are numbered as
  sent to the search list in the order specified by
  mv_return_fields, starting from 0 and proceeding
  upwards. If column names, they are as found in  the
  first record of the searched file (by default the ASCII
  source for the product database), except for the key or
  first field. followed by a required colon (:) and the
  options, if any.

Maybe not so clear, but the last line says that the first field
cannot be accessed using the column/filed name. 8-)

>
> [loop-data test bar]
> <BR>
>
> [/tag]
>
> 2.  The database (test):
>
> foo	bar
> 1	1
> 2	2
> 3	3
> 4	4
> 5	5
> 6	6
> 7	7
> 8	8
> 9	9
> 10	10
>
> 3.  The results:
>
> 5
> 1
> 4
> 10
> 7
> 3
> 6
> 9
> 2
> 8
>
> Completely removing the [sort] option returns the same result -
> indicating, possibly, that [sort] for databases other than 'products' is
> broken.  Is this true?  If so, why even bother including it in the
> standard [sort] syntax??  Furthermore, why the heck wouldn't Minivend
> just return results as they were read from the database?

It is. . . Don't assume that gdbm organizes its data in the same
order as products.asc or test.asc!  Since the sort on field name wasn't
recognized, it's returning the list in gdbm unsorted order.

- bj

-- 

                -------------------------------------------------
               |             Robert  N.  Jordan                  |
               |             Software  Services                  |
               |             Web-Site Authoring                  |
               |  P O Box 513              Londonderry, VT 05148 |
               |  802-824-5542                 Fax: 802-824-4321 |
               |  bjordan@sover.net     http://www.vtweb.com/bj/ |
                -------------------------------------------------


Search for: Match: Format: Sort by: