XML Library and Windows

Jan Schenkel janschenkel at yahoo.com
Wed Mar 1 15:47:33 EST 2006


--- Karen <Karen at curlypaws.com> wrote:
> Hi Jan,
> 
> Thanks very much for that, but as I'm building on
> the Mac only, I had  
> to use something that Trevor DeVore had previously
> suggested - 
>
<http://article.gmane.org/gmane.comp.ide.revolution.user/64387/match=set+external>

> 
> The problem I'm now having is that Quartam says it
> can't find the  
> report formats.  Is there some trick to the path to
> use for this in  
> Windows?
> 
> Thanks,
> 
> Karen
> 

Hi Karen,

Glad to hear you have found a way to get revXML into
working order -- let's hope the standalone builder
gets fixed in 2.7.1 so nobody else has to work around
it.

As for the report formats: when you refer to a file
using a relative path, the Rev engine starts to search
from the 'defaultFolder' -- when you fire up the Rev
IDE, this is the folder where the Rev application
resides.

In your standalone, it refers to the folder where your
standalone resides -- but there's a twist: on Windows,
this is the same directory as where the .exe file
lives ; but as MacOSX applications are actually
folders themselves (bundles of files), the
'defaultFolder' points to the folder _inside_ the
bundle where the actual executable file is hidden.

If your reports live in a subdirectory next to the
.app bundle, you have two options: change the
defaultFolder, or refer to these files by combining
the .app bundle location and the relative location of
your report format files.

A popular cross-platform function to get the
appropriate path was written by Richard Gaskin:
##
function AppPath
  put the filename of this stack into tPath
  set the itemdel to "/"
  If (IsOSX()) then
    get offset(".app/Contents/MacOS/", tPath)
    if it > 0 then -- 2.4.3 or later
      delete char it to len(tPath) of tPath
    end if
  end if
  delete last item of tPath
  return tPath &"/"
end AppPath

function IsOSX
  if the platform is not "MacOS" then return false
  get the systemversion
  set the itemdel to "."
  if item 1 of it >= 10 then return true
  return false
end IsOSX
##
(for a more complete explanation, go to:
<http://www.sonsothunder.com/devres/revolution/tips/file008.htm>)

So, armed with the function above, you can change the
path to the report layout file as follows:
##
on mouseUp
  -- prep all the variables
  put AppPath() & "reports/myreport.qrl" \
      into tLayoutPath
  put "MyDataStack" into tStackName
  put true into tPreviewFlag
  put "all" into tCardRange
  -- and print the data stack
  qrtReports_PrintReportFromStack \
      tLayoutPath,tStackName,tPreviewFlag,tCardRange
end mouseUp
##

Hope this helped,

Jan Schenkel.

Quartam Reports for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the use-livecode mailing list