Creating Library Modules

dcpbarrington dpierce at xpertassist.com
Wed Jul 9 14:39:52 EDT 2008


Greetings,

I have a Rev 2.9 application that I'm building that creates a set of
reports.  I have the report working as a button in the main stack, but I now
want to create a library module that will allow me to seperate the report
code from the main stack so it can be pulled in with different report
versions as needed.

I created a new STACK called it "StandardReports.rev"

I moved the code that I know was working to the "StandardReports.rev" stack
script area.

In the original stack I make the following call to see if the new stack is
running.

  if "StandardReports" is not among the lines of the StacksInUse then  
    start using stack "StandardReports"
  end if

The function call to the new stack works, but in that stack there are a
number of Commands that are defined in the Main Stack that are no longer
found by the routines in the "StandardReport" stack.

One example is when I do a DB call, I check for an error with
handleRevDBerror command that is defined as:

on handleRevDBerror pError
  switch
  case item 1 of pError is "revdberr"
    return "Database Error: " & pError
    break
   end switch
end handleRevDBerror

Revolution errors when ever the "StandardReport" stack tries to call this
command.

What do I need to do to be able to access Commands and Functions that are in
the Main Stack?

ALSO, can the "StandardReport.rev" file be placed in any directory or does
it need to be with the main stack?


Thanks for the help
-- 
View this message in context: http://www.nabble.com/Creating-Library-Modules-tp18368070p18368070.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list