%Library.Global Export

Globals, Caché

Hi,

I'm trying to export a global with this library %Library.Global with this call:

Do ##class(%Library.Global).Export(pstrNamespace, pstrGlobalName, pstrOutputPath,,,"-d")

When I call this method $ZERROR is setted to "<NOTOPEN>OpenDev+15^%Wprim"

Can someone tell me where is the problem on this?

Thanks a lot

  • 0
  • 0
  • 198
  • 3
  • 1

Answers

There was invalid (null) file name (pstrOutputPath variable) which caused the problem.

Comments

Please, could you also post values of given variables pstrNamespacepstrGlobalNamepstrOutputPath? What OS/Caché version it is?
Try to also use "d" parameter instead of "-d" and check the status returned by method:

  Set sc = ##class(%Library.Global).Export(pstrNamespace, pstrGlobalName, pstrOutputPath,,,"-d")
  Do $system.OBJ.DIsplayError(sc)

It should return more information about the error.

Generally it tries to use device (file?) which was not opened, given line in version 2017.2.1 is:
    Xecute code Quit:'$t 0 Use dev Quit 1

Eventually to get more details about error: Do $system.Status.DecomposeStatus(sc,.err) zw err

Thank you very much for your response.

Checking for this data I realized that pstrOutputPath was null so it can't work.

Now it's fixed.