go to post Vitaliy Serdtsev · Jun 7, 2017 See "predefine the type of an specific piece of a global" USER>s a=" 1.0", b=" 2.2" w w !,a]]b a=" 1.0" b=" 2.2" 0 USER>s a=$double(1.0), b=$double(2.2) w w !,a]]b a=1 b=2.2000000000000001776 0
go to post Vitaliy Serdtsev · Jun 7, 2017 Ok, exclusively for fun. I made some improvements and now my score is 9, but if you try very hard, even - 0!Who less ? ;) Here is the code: Class ITPlanet.Task2 [ Abstract ] { Parameter p = {$zwbunpack("㤸㜶㔴㌲")}; ClassMethod main() As %String { q ..#p } } Class ITPlanet.Test [ Abstract ] { ClassMethod length( class = {$classname()}, method = "main") As %Integer [ CodeMode = expression ] { ##class(%Dictionary.MethodDefinition).IDKEYOpen(class, method).Implementation.Size } ClassMethod test(makeDeploy = {$$$NO}) { ;do ##class(ITPlanet.Test).test() set classname="ITPlanet.Task2" set check=9876543210 do:makeDeploy $system.OBJ.MakeClassDeployed(classname) set result=$classmethod(classname,"main") write !,result,!,check, !,"correct: ",$select(result=check:"yes",1:"no"), !,"length: ",..length(classname) } } USER>do ##class(ITPlanet.Test).test() 9876543210 9876543210 correct: yes length: 9 USER>do ##class(ITPlanet.Test).test(1) 9876543210 9876543210 correct: yes length: 0
go to post Vitaliy Serdtsev · Jun 7, 2017 Here my very old article on the subject (machine translation).
go to post Vitaliy Serdtsev · Jun 6, 2017 Rhetorical question - for what?If for fun, then this is possible.But I will tell the solution here later.
go to post Vitaliy Serdtsev · Jun 6, 2017 My result is 21.It is similar to the variant of Alexander, but only _+"".
go to post Vitaliy Serdtsev · Jun 6, 2017 You can use the class %ZEN.proxyObject, e.g.: Class demo.Customer Extends %RegisteredObject { Property p1 As %String; Property p2 As %String; Property list As %Collection.ListOfDT; /// d ##class(demo.Customer).Test() ClassMethod Test() { s customer=##class(demo.Customer).%New() s customer.p1="p1" s customer.p2="p2" s customer.list=##class(%ListOfDataTypes).%New() d customer.list.InsertList($lb(1,"two",,"four")) s appointment=##class(%ZEN.proxyObject).%New() s appointment.a1="a1" s appointment.a2="a2" s appointment.list=##class(%ListOfDataTypes).%New() d appointment.list.InsertList($lb(2,3,"test",8)) ; Cancellation s response=##class(%ZEN.proxyObject).%New() s response.Code="Cancellation" s response.Info="Info_Cancellation" w response.Code,":",! d response.%ToJSON(,"2aelow") d response.%Clear() ; Customer s response.Code="Customer" s response.Info=customer w !!,response.Code,":",! d response.%ToJSON(,"2aelow") d response.%Clear() ; Appointment s response.Code="Appointment" s response.Info=appointment w !!,response.Code,":",! d response.%ToJSON(,"2aelow") } } USER>d ##class(demo.Customer).Test() Cancellation: { "Code":"Cancellation", "Info":"Info_Cancellation" } Customer: { "Code":"Customer", "Info": { "p1":"p1", "p2":"p2", "list":["1","two","","four"] } } Appointment: { "Code":"Appointment", "Info": { "a1":"a1", "a2":"a2", "list":[2,3,"test",8 ] } }
go to post Vitaliy Serdtsev · Jun 2, 2017 The translation was already done: Localization in Caché DBMS
go to post Vitaliy Serdtsev · Jun 2, 2017 See still of the source code for the following methods:##class(%Net.MIMEWriter).EncodeStreamBase64()##class(%Net.SMTP).EncodeStreamBase64()##class(%Atelier.v1.Utils.General).Base64FromStream()##class(%XML.Writer).WriteBase64()
go to post Vitaliy Serdtsev · May 29, 2017 I want to say that this question was already asked and there it was given some answer. No more than.I personally use Studio and will continue to use.
go to post Vitaliy Serdtsev · May 26, 2017 What is ..IsIgnored and ..PathDependencies? You could post a complete example?
go to post Vitaliy Serdtsev · May 26, 2017 Initially the question was about alternative ways of solving the issue (in addition to recursive FileSet and $ZSEARCH). I just proposed a third method, namely using the capabilities of the OS itself. Maybe someone here didn't know about it. Which option at end to choose - to solve the developer. We here vote for the best solution or in general for offered solutions? If the first, then I'll pass.
go to post Vitaliy Serdtsev · May 26, 2017 And if so? d ##class(%Net.Remote.Utility).RunCommandViaZF($$$FormatText("dir /A-D /B /S %1",$$$quote("C:\InterSystems\Atelier")),.tFileName,,,$$$NO) s f=##class(%Stream.FileCharacter).%New() s f.Filename=tFileName while('f.AtEnd) {w f.ReadLine(),!} s f="" d ##class(%File).Delete(tFileName)
go to post Vitaliy Serdtsev · May 26, 2017 Anything with this flag can change or be removed with no warning. There are a few comments: Let's say that the developers changed something in new versions of the DBMS. Is this a problem? It is enough to check Caché Recent Upgrade Checklists, where usually there is a ready list of changes that may affect existing user code, for example. Note that this can apply to absolutely any member of a class, and not even marked as [Internal]. Suffice it to recall the recent story with JSON support. For a class does not exist flag [Internal], the warning is only on the level of comments. As for the other members of the class, according to the documentation this flag is for other purposes, namely: Internal class members are not displayed in the class documentation. This keyword is useful if you want users to see a class but not see all its members. proof In any case, the final choice for developer.
go to post Vitaliy Serdtsev · May 25, 2017 Does this example need to handle this? Correct, of course, to close the device: #include %systemInclude #dim cDev As %String = $IO ; see "dir /?" and RunCommandViaZF() d ##class(%Net.Remote.Utility).RunCommandViaCPIPE(...,.dev,.con) /* ... */ c:($get(dev)'="") dev:"I" u cDevAlso, do you not worry that its an internal class? No, since for me internal ≠ deprecated. However, given the openness of the source code, you can make own similar method, thereby to protect yourself from possible issues in the future.
go to post Vitaliy Serdtsev · May 25, 2017 $ZF() do $zf(-1,"pkzipc.exe -extr -over=all [and etc.]")Instead of pkzip, you can use 7z, rar, gzip32 etc.
go to post Vitaliy Serdtsev · May 24, 2017 <...> but maybe there's a better solution? Yes, of course. E.g. (for Windows x64): #include %systemInclude ; see "dir /?" d ##class(%Net.Remote.Utility).RunCommandViaCPIPE($$$FormatText("dir /A-D /B /S %1",$$$quote("C:\Program Files (x86)\Common Files\InterSystems")),,.con) ; string -> array d ##class(%ListOfDataTypes).BuildValueArray($lfs($e(con,1,*-2),$$$NL),.array) zw array