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 4 of 11 Topic 894 of 992
Post > Topic >>

Re: Retrieve an array using non-subscript data

by Rob Tweed <rtweed@[EMAIL PROTECTED] > Oct 3, 2007 at 03:40 PM

Sebastien

Take a look at http://gradvs1.mgateway.com/download/extreme1.pdf

It may help you understand globals, particularly if your previous
experience is oriented towards relational models

Rob

On Wed, 03 Oct 2007 04:47:24 -0700, Sébastien de Mapias
<sglrigaud@[EMAIL PROTECTED]
> wrote:

>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) = "ABC`12380`xyz"
>~ set ^Stuff(2) = "DEF`98787`ghf"
>
>in order to index Stuff data other than the numeric subscript used
>above you have to do the following ?:
>~ i := how many records Stuff contains
>~ for x := 1 up to i loop
>~   field2_value := get 2nd value in array of ^Stuff(x)
>~   ^StuffX(field2_value) := x
>~   /* or if several times the same value possible:
>~   ^Stuff(field2_value,x) := null */
>~ end loop
>
>Is this *really* the way to go ? Is this how it works with M[umps] ??
>
>Thanks !
>Regards,
>Sébastien
>
>
>On 3 okt, 10:12, John Murray <jo...@[EMAIL PROTECTED]
> wrote:
>> Index example:
>>
>> Construct and maintain ^StuffX(piece2)=i (if there can only be a
maximum
>> of one record with a given piece-2 value), or ^StuffX(piece2,i)="" (if
>> there can be multiple records with a given piece-2 value).
>>
>> Then (first case):
>>
>>         set i=$get(^StuffX(12380))
>>         if i'="" do ProcessStuff
>>
>> Or (second case):
>>
>>         set i=""
>>         for  set i=$order(^StuffX(12380,i)) quit:i=""  do
>> ProcessStuff(i) quit
>>

---

Rob Tweed
Company: M/Gateway Developments Ltd 
Registered in England: No 3220901
Registered Office: 58 Francis Road,Ashford, Kent TN23 7UR

Web-site: http://www.mgateway.com

Out of the Slipstream: Come to the conference!
http://www.outoftheslipstream.com
 




 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 Sat Jul 26 0:01:24 CDT 2008.