David Brock · Jul 1, 2019 go to post

Thanks for the confirmation.

I right clicked the Class in explorer (in VSCode), hit export and nothing happened.

Is it saved somewhere locally ? If so how do I define where it should save it ?

David

David Brock · Jul 1, 2019 go to post

Dmitry,

An amazing piece of work.

I tested this with a local install of IRIS:
IRIS for Windows (x86-64) 2019.1 (Build 510U) Thu Mar 14 2019 14:13:37 EDT

In Studio I created a test class in the USER namespace

I then opened VSCode, changed to the USER namespace and was able to open the test class

However when I tried to edit the code I saw: 

Not sure what's wrong here - any suggestions ?

Thanks,

David

David Brock · Feb 23, 2019 go to post

Variables should never be global in scope.

As others have said they should be part of class instances or passed by reference.

PPGs are intended more for very local, non persistent, storage - e.g. private data within a spawned job.

David Brock · Oct 18, 2017 go to post

set status = $$$ERROR($$$SQLError, $System.SQL.SQLCODE(SQLCODE))

Would return a %Status value with the text of the SQLCODE error available.

The previous answer would give the SQLCODE error number.

Use whichever is appropriate

David Brock · May 23, 2017 go to post

There should be  another call to AuthenticateWithUsername should be before the Connect call (as well as after the Connect call)

David Brock · Oct 1, 2016 go to post

$ListNext is generally faster, however for production code the following pattern should be used:

set pointer = 0
while ($listnext(list,pointer,listpart)) {
    continue:($data(listpart)=0)
    #; listpart is valid
    
}

This correctly deals with a trailing comma in the list, e.g.

set list = $listbuild(1,2,3,)

If this is fed to $listnext then listpiece will be undefined for the last iteration

David Brock · Oct 1, 2016 go to post

Be careful when using the target parameter to $order. See the documentation for target.

If there is no data present at the node being iterated over then the target value will retain its last set value - to ensure you always use the correct value when set, kill the target variable before the $order statement and check it's validity before use with $data, e.g.

kill Data
Set Sub3 = $Order(^Trans(Sub1,Sub2,Sub3),1,Data)
quit:(Sub3="")
if ($data(Data)) {
    Write ?6,Sub3," = ",Data
    Write Data,!
}