Question Davidson Espindola · Mar 26, 2018

error compilation studio

Good morning, employees

I'm having trouble compiling in studio, I already reported it to intersystems support, but it did not solve the problem.

when calling a method of a class by putting $, follows an example:

set obj = ## class (% AbstractObject). $ fromJSON (data)ERROR: SearchCep.int (29) # 1011: Invalid name: '## class (% Library.AbstractObject) $ fromJSON (data)': Offset: 45 [SearchCep + 28 ^ SearchCep]

the studio compiles, and the application performs perfectly, but in the studio it presents error.
Someone has already encountered this type of error.

Following is a sample application.

W #
Set http = ## class (% Net.HttpRequest).% New ()
Set http.Server = "viacep.com.br"
From http.Get ("/ ws /" _ zip_ "/ json /")
Set data = http.HttpResponse.Data.Read ()
set obj = ## class (% AbstractObject). $ fromJSON (data)
set iter = obj. $ getIterator ()
while iter $ getNext (.key, .value) {s x = "s" _key _ "=" _ $ C (34) _value_ $ c (34) x x}
d obj.% Close ()
d http.% Close ()
k http, obj, iter, data, key, x, value
w !!!
w

thankful
Davidson

Comments

John Murray · Mar 26, 2018

I'm seeing extra whitespace characters at unexpected places in the code fragments you posted. For example between  $ and fromJSON(data)

What is your $ZVERSION value? The $-style methods got introduced at one point, then removed in a later version.

0
John Murray  Mar 26, 2018 to John Murray

Specifically, the $-style methods (called system methods) were introduced in 2016.1 and then removed in 2016.2. See here for details.

0
Davidson Espindola  Mar 26, 2018 to John Murray

Perfect John,

Solved my problem, thank you very much.

God bless
Hug

0
Davidson Espindola · Mar 26, 2018

Jonh, 

In the application, there are no spaces as informed, when posting there must have been some error in the edit.
I executed in several cache versions, both presented the same errors.

Cache for Windows (x86-64) 2017.2.1 (Build 801) Wed Dec 6 2017 09:19:46 EST
Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2016.1 (Build 656) Fri Mar 11 2016 17:55:22 EST

waiting
Thank you

0