ClassMethod Max(args...)
{
q:(+$g(args)<2) $lb($g(args(+$g(args))),+$g(args))
s max=$g(args(1))
for i=2:1:args { s:($g(args(i))]]max) max=$g(args(i)),maxI=i }
q $lb(max,$g(maxI,1))
}
- Log in to post comments
ClassMethod Max(args...)
{
q:(+$g(args)<2) $lb($g(args(+$g(args))),+$g(args))
s max=$g(args(1))
for i=2:1:args { s:($g(args(i))]]max) max=$g(args(i)),maxI=i }
q $lb(max,$g(maxI,1))
}
That function has one nasty feature: If any
Thank you, it seems to work.
$SYSTEM.OBJ.Export("WRC.Text.cls","C:\export.xml","/recursive=1")
Be careful when using ##Unique.
The problems with scope of generated "unique" variable can introduce weird bugs (in some cases it is not as unique as you would expect; WRC problems 879820 and 879901).
Citing ISC support from WRC 879820:
The problem is that the variable name created by ##Unique is only unique among the set of variables for that method. However, the variable itself is globally scoped. Since the variable name is globally scoped, I think the variable names should be unique for the entire class, not just for the method. I will report this to development. Please note, however, since the variable is globally scoped, using the preprocessor directive as you are here will leak information to any code that calls this class. To prevent this, you should NEW the variable prior to using it: #define A(%x) NEW #Unique(new) SET #Unique(old)=%x
Also ##Unique directives cannot be used in nested macros (macro calling another macro; WRC 879901).
I am trying to generate same output as http://php.net/manual/en/function.crypt.php crypt function (CRYPT_MD5 flavor).
So for example
$salt=crypt("2Ggaobjb","$1$1a2b3c4d$");
returns $1$1a2b3c4d$Y5tt50CQ12xW2saeYnI43, which is not same as pure MD5 hash (like $SYSTEM.Encryption.MD5Hash).
From documentation it seems that crypt creates derived hash based on MD5, but it is not the same.
Thanks, but unfortunately I am unable to find suitable DLL for Win64 with crypt function. I have found 32bit version (GnuWin32/crypt), but it does not work on 64bit environment.
Thank you. We are now using Java gateway and we want to replace this with something more native. So it seems that writing own implementation in COS is the only option left. I was hoping that someone has already done that ;)
Even if not for April 1st, it's too good to be true :)
Not a problem with the function itself.
w 1.0000000000000000001
1
| Class ITPlanet.Task2 [ Abstract ] |
| { |
| ClassMethod Main() As %String |
| { |
| q $tr($h,",") |
| } |
}
*You may need to set your date and time settings to 2111-05-30 12:00:10 ;)
Try using iFind indices:
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GIKNOW_ifind
I've contacted WRC about this, and their answer is that there is no built-in way.
They offered a workaround of enabling unauthenticated access and checking AUTHORIZATION header manually.
Try
Index TagsArrayIndex On (TagsArray(ELEMENTS), TagsArray(KEYS));
Is it possible that you added index definitions after you filled the table with data?
If that is the case, then those indices are not built ("empty"), and so if the query uses them, then it returns no data. In such case you have to build your indices manually via ##class(MML.Cities).%BuildIndices().
s dyn={}
d dyn.%Set("asNumber",123)
d dyn.%Set("asString",123,"string")
w dyn.%ToJSON()
{"asNumber":123,"asString":"123"}