Question: DocumentTools Retrieve function returns the message "unable to retrieve label reference"

Hi

I'm trying to use the command: DocumentTools[Retrieve](path,label), but i recieve the message "unable to retrieve label reference" no mather what i do. When i use the GUI: Insert - reference and get the value it works fine, but in that way I can't assign the value to a variable in the document.

here is an example:

The document i want to retrieve a value from:

restart;

a := 5;

#a gets the label (1)

 

The document i want to retrieve the value to:

restart;
with(DocumentTools);

path := FileTools:-JoinPath(["test.mw"], base = worksheetdir); = "C:\Users\Nicolai\CloudStation\Nicolai\Skole stof\Sem 7\test.mw"

 

Retrieve(path, "());
Retrieve(path, "(1)");
Retrieve(path, "a");

#None of the above works

 

Is it even possible to do such thing?

with best regards

Nicolai

Please Wait...