Doh, typo in my "fake" code... It should read:
==========
set foo("bar", "baz") = "stuff"
set foo("bar", "hello") = "world"
==========
Sorry. :(
Jason
> Array cannot be passed as value, it should be passed as reference(aka
> pointer).
> Cache syntax is you need to add a full stop like this do
> someMethod(.foo)
> Please see the below sample codes.
Ah, that is good to know. I am glad I asked the pros for help! :D
Thanks so much for the clarification, I really appreciate it.
Have an excellent day.
Cheers,
Micky
> %request is a public variable that is available everywhere so you
> don't need to pass it.
Good to know! I was kinda wondering about that.
Question: If you wanted to manipulate %request.Data, but not change
the current %request.Data, would %ConstructClone() be the appropriate
method to use?
Example code (tested, and appears to work):
<script language="cache" runat="server">
#define qs(%r, %key, %val) set %r.Data(%key, $order(%r.Data(%key, ""),
- 1) + 1) = %val // Macros rock!
set r = %request.%ConstructClone()
$$$qs(r, "foo", "2")
$$$qs(r, "subsection", "all")
#undef qs
</script>
The above is what I suggested to Gordon (%ConstructClone()), but I am
far from being a pro COS/CSP/Caché guru (like ya'll)... Just curious
if my suggestion is a valid approach, or if using %ConstructClone() on
%request is a bad idea (might be overkill if all you need to
manipulate is the query string key/value pairs)?
A billion thanks for the help!
Have a great day/night.
Cheers,
Micky
Boy, am I glad I asked. :)
Thanks! I really appreciate the clarification.
Have a great week!
Cheers,
Micky