Question Anna Golitsyna · May 12, 2021

$preprocess failure

There is an undocumented command, $preprocess, that can be called as below. In this case it takes the class name and converts its code into a text array. That includes comments as well. Two questions about it if you know:

  1. Is that the only job that $preprocess does?
  2. Why would it generally work for most classes except for a single class? This is probably a bug since it works in a later Cache option for this class too but I need to work with this Cache version as well. This class does not contain any control characters except for plain vanilla tabs, checked.

Set tResultCode=$preprocess(pClassName,0,pTextArray,tErrList)

Product version: Caché 2014.1

Comments

Dmitry Maslennikov · May 12, 2021

I would not recommend using such undocumented functions like this. Instead, of this you can switch to something else. Like $system.OBJ.ExportUDL, or some other internal methods

##class(%Atelier.v2.Utils.TextServices).GetTextAsArray() 

##class(%Compiler.UDL.TextServices).GetTextAsArray()

0
Anna Golitsyna  May 12, 2021 to Dmitry Maslennikov

Dmitry, thanks for the advice. The first function is not available in this Cache version and it will actually export, not just convert code to an array. The Atelier one calls the $preprocess command in question inside its stack and Atelier is not available in this Cache version either. The last function would be perfect but it also calls the $preprocess command in question and this is exactly where the call for this specific class dies, inside $preprocess.

0
Dmitry Maslennikov  May 12, 2021 to Anna Golitsyna

Well, just noticed the version you have, any chance to upgrade such an old version to at least 2016.2

0
Anna Golitsyna  May 12, 2021 to Dmitry Maslennikov

Unfortunately not for the time being.

0
Marc Mundt · May 12, 2021

Is the problematic class particularly large?

0
Anna Golitsyna  May 13, 2021 to Marc Mundt

That was one of the first ideas that I checked before posting here. Yes, it is large comparing to most other package classes but two much larger classes from the same package have been imported alright.

0
Dmitry Maslennikov · May 13, 2021

So, you just need help in find the place in the class which cause an error?

I would suggest to try removing each class member one by one, until you’ll narrow it to one member, and maybe you’ll realize why it’s happening.

0
Anna Golitsyna  May 13, 2021 to Dmitry Maslennikov

If a specific class member causes this, yes, that might work indeed. I need to try it.

0