go to post David Brock · Jul 1, 2019 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
go to post David Brock · Jul 1, 2019 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 EDTIn Studio I created a test class in the USER namespaceI then opened VSCode, changed to the USER namespace and was able to open the test classHowever when I tried to edit the code I saw: Not sure what's wrong here - any suggestions ?Thanks,David
go to post David Brock · Feb 23, 2019 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.
go to post David Brock · Oct 18, 2017 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
go to post David Brock · May 23, 2017 There should be another call to AuthenticateWithUsername should be before the Connect call (as well as after the Connect call)
go to post David Brock · Oct 1, 2016 $ListNext is generally faster, however for production code the following pattern should be used:set pointer = 0while ($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
go to post David Brock · Oct 1, 2016 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 DataSet Sub3 = $Order(^Trans(Sub1,Sub2,Sub3),1,Data)quit:(Sub3="")if ($data(Data)) { Write ?6,Sub3," = ",Data Write Data,!}