Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Mumps > Re: Retrieve an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 11 Topic 894 of 991
Post > Topic >>

Re: Retrieve an array using non-subscript data

by =?iso-8859-1?q?S=E9bastien_de_Mapias?= <sglrigaud@[EMAIL PROTECTED] > Oct 3, 2007 at 04:47 AM

OK thanks a lot John.

Do you mean that creating indices like you put it (with an 'X' suffix
at the end of your globals names) is a convention when using M[umps] ?

To make sure I understood the syntax and how it works (because I'm
*very* new to M language) when you have a global 'Stuff' containing
zillions of records like:
~ set ^Stuff(1) =3D "ABC`12380`xyz"
~ set ^Stuff(2) =3D "DEF`98787`ghf"

in order to index Stuff data other than the numeric subscript used
above you have to do the following ?:
~ i :=3D how many records Stuff contains
~ for x :=3D 1 up to i loop
~   field2_value :=3D get 2nd value in array of ^Stuff(x)
~   ^StuffX(field2_value) :=3D x
~   /* or if several times the same value possible:
~   ^Stuff(field2_value,x) :=3D null */
~ end loop

Is this *really* the way to go ? Is this how it works with M[umps] ??

Thanks !
Regards,
S=E9bastien


On 3 okt, 10:12, John Murray <jo...@[EMAIL PROTECTED]
> wrote:
> Index example:
>
> Construct and maintain ^StuffX(piece2)=3Di (if there can only be a
maximum
> of one record with a given piece-2 value), or ^StuffX(piece2,i)=3D"" (if
> there can be multiple records with a given piece-2 value).
>
> Then (first case):
>
>         set i=3D$get(^StuffX(12380))
>         if i'=3D"" do ProcessStuff
>
> Or (second case):
>
>         set i=3D""
>         for  set i=3D$order(^StuffX(12380,i)) quit:i=3D""  do
> ProcessStuff(i) quit
>
 




 11 Posts in Topic:
Retrieve an array using non-subscript data
=?iso-8859-1?q?S=E9bastie  2007-10-03 00:31:34 
RE: Retrieve an array using non-subscript data
John Murray <johnm@[EM  2007-10-03 09:12:50 
Re: Retrieve an array using non-subscript data
=?iso-8859-1?q?S=E9bastie  2007-10-03 04:47:24 
Re: Retrieve an array using non-subscript data
Rob Tweed <rtweed@[EMA  2007-10-03 15:40:39 
Re: Retrieve an array using non-subscript data
John Murray <johnm@[EM  2007-10-03 15:47:19 
Re: Retrieve an array using non-subscript data
=?iso-8859-1?q?S=E9bastie  2007-10-03 23:53:59 
Re: Retrieve an array using non-subscript data
"K.S. Bhaskar"   2007-10-04 07:10:13 
Re: Retrieve an array using non-subscript data
"K.S. Bhaskar"   2007-10-03 07:04:00 
Re: Retrieve an array using non-subscript data
=?iso-8859-1?q?S=E9bastie  2007-10-03 08:30:46 
Re: Retrieve an array using non-subscript data
Pete <peter.charbonnie  2007-10-03 17:35:28 
Re: Retrieve an array using non-subscript data
lmv <lverhulst@[EMAIL   2007-10-04 09:06:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 0:38:32 CDT 2008.