Wayn wrote:
> here is where i am sofar after adding addline....now
> somethings dont work and the databaase wont update
> ...............
I think you are testing too many new things at once, instead of testing
individual things to make sure they work before you put them together.
=======================================================================
> : load 'mybot.p'
> ;;; LOADING mybot.p
> ;;; LOADING mydatabase.p
>
> ;;; MISHAP - msep: MISSING SEPARATOR (eg semicolon)
> ;;; INVOLVING: ] [
> ;;; FILE : c:\program
> files\poplog\15.5\mydatabase.p LINE NUMBER:
> ;;; 2
> ;;; DOING : loadcompiler loadcompiler
That shows that you have a syntactic error in your file mydatabase.p
Check out the contents of mydatabase.p
That sort of thing would happen if you try to compile (load) a file that
contains things like:
[a b c]
[d e f]
In pop11 you can't write a program in which you simply put one
list expression after another unless they are included in a larger
structure, e.g. a list or vector.
This is OK
[
[a b c]
[d e f]
]
So is this, if you want a vector of lists.
{
[a b c]
[d e f]
}
So the first thing is to make your program compile by removing
whatever the syntactic problem is.
If the program mydatabase.p is automatically generated then
either you have to make the program that creates the
file start with '[' and end with something like
'] -> database;'
Alternatively do not use 'load', but instead use a program
that reads in one list at a time and adds the lists to database.
You can use a program I have just added to the bham local library:
http://www.cs.bham.ac.uk/research/poplog/auto/read_lists_in_file.p
(On unix/linux put that in $poplocal/local/auto.
On windows put it in the \poplog\pop\local\auto )
It is described here
http://www.cs.bham.ac.uk/research/poplog/help/read_lists_in_file
This assumes you can write a list to the end of a file. The following
will achieve that
define append_list_to_file(filename, list);
;;; Print the list to the end of the file with name filename
;;; If the file does not already exist it will be created.
;;; create an 'append' character consumer and make that the
;;; output channel for characters printed, e.g. by 'pr'.
dlocal cucharout = discappend(filename);
;;; Print the list with quote marks for strings
dlocal pop_pr_quotes = true;
pr(list);
;;; add a newline
pr(newline);
;;; close the file
pr(termin);
enddefine;
;;; Test it with commands like this
append_list_to_file('mydata.p', [this is a silly list 'with a string']);
Then look in the file mydata.p
more to follow.
Aaron
==
http://www.cs.bham.ac.uk/~axs/
|