Hi,

Just ran into something I don't understand.
I have the functor below compiled and copied into x-oz://system/user as Csv.ozf.


functor
import
  QTk
  Open
  System
export
  GetCell
  GetRow
  OpenCsv
  ParseLine
define
  fun {ParseLine L}
     {List.toTuple line {String.tokens L &,}}
  end

  fun {GetCell Record Row Col}
     Record.Row.Col
  end

  fun {GetRow Record Row}
     Record.Row
  end

  proc {OpenCsv File?}
     try
    FileName={QTk.dialogbox load(title:"Select CSV file"
                     defaultextension:"csv"
                     filetypes:q(q("All Files" q("*"))) $)}
     in
    {New Open.file init(name:FileName flags:[read]) File}
     catch
    error(_)
     then
    {System.show 'Error'}
     end
  end
end


------- when I try to use it from my main program,

declare
Temp File
[Csv]={Module.link ["x-oz://system/user/Csv.ozf"]}
[QTk]={Module.link ["x-oz://system/wp/QTk.ozf"]}
Record

{Csv.openCsv File}
{File read(list:Temp size:all)}
{File close}
Record={Map {String.tokens Temp &\n} Csv.parseLine}
{Browse {Csv.getCell Record 1 4}}

-------I get the error message

%********************** Error: module manager *******************
%**
%** Could not link module
%**
%** Could not load functor at URL: x-oz://system/user/QTk.ozf
%**--------------------------------------------------------------

why is mozart trying to link QTk from this location and not the one specified? I thought this would have something to do with using QTk in the functor and the main oz program, but I can't remove it from the functor because then that won't compile and it doesn't make a difference whether I have it in the oz program or not.

Regards

Mark

--
Mark Richardson
Final year undergraduate
University of Teesside
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to