RE: [U2] K = K
Doh ! And there I was thinking u2 related to any multi-value/post-relational/pick-derived or whatever it's generically called database. Thanks for the correction. And many thanks for those who pointed out the $OPTIONS EXT. This is a great help to me, not only with REMOVE but also with stuff like SWAP and FMT. You see, people do win on the u2 users group. Date: Thu, 20 Jan 2005 08:38:26 -0700 From: Kevin King [EMAIL PROTECTED] Subject: RE: [U2] K = K Uh... Hate to break it to you, but... D3 isn't U2. Checked by MimeSweeper Fri, 21 Jan 2005 09:23:12 - --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] K = K
I've just started at a new site running D3 7.2.1.RS on AIX and the REMOVE statement doesn't compile at all! It's very annoying as it's a very convenient way of processing dynamic arrays and with larger arrays far more efficient than counting the markers and FOR... NEXTing through it. I'm suprised that REMOVE isn't universal amongst U2 BASICs. Regards, Chris Bill writes - In UniData and D3 the REMOVE statement looks like: REMOVE variable FROM dynamic.array AT position.variable SETTING delimiter.variable This allows the explicit setting of the pointer, without resorting to reinitialization by reassigning the array variable. I've always just assigned Position.Variable prior to doing any REMOVE stuff. But then, UniVerse is sometimes a different animal. :-) Checked by MimeSweeper Thu, 20 Jan 2005 14:56:43 - --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] K = K
Uh... Hate to break it to you, but... D3 isn't U2. -Kevin [EMAIL PROTECTED] http://www.PrecisOnline.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, January 20, 2005 7:57 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] K = K I've just started at a new site running D3 7.2.1.RS on AIX and the REMOVE statement doesn't compile at all! It's very annoying as it's a very convenient way of processing dynamic arrays and with larger arrays far more efficient than counting the markers and FOR... NEXTing through it. I'm suprised that REMOVE isn't universal amongst U2 BASICs. Regards, Chris Bill writes - In UniData and D3 the REMOVE statement looks like: REMOVE variable FROM dynamic.array AT position.variable SETTING delimiter.variable This allows the explicit setting of the pointer, without resorting to reinitialization by reassigning the array variable. I've always just assigned Position.Variable prior to doing any REMOVE stuff. But then, UniVerse is sometimes a different animal. :-) Checked by MimeSweeper Thu, 20 Jan 2005 14:56:43 - --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] K = K
Chris: Place: $OPTIONS EXT at the beginning of the program then try to compile again. This should do the trick. Bill -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Thursday, January 20, 2005 6:57 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] K = K I've just started at a new site running D3 7.2.1.RS on AIX and the REMOVE statement doesn't compile at all! It's very annoying as it's a very convenient way of processing dynamic arrays and with larger arrays far more efficient than counting the markers and FOR... NEXTing through it. I'm suprised that REMOVE isn't universal amongst U2 BASICs. Regards, Chris Bill writes - In UniData and D3 the REMOVE statement looks like: REMOVE variable FROM dynamic.array AT position.variable SETTING delimiter.variable This allows the explicit setting of the pointer, without resorting to reinitialization by reassigning the array variable. I've always just assigned Position.Variable prior to doing any REMOVE stuff. But then, UniVerse is sometimes a different animal. :-) Checked by MimeSweeper Thu, 20 Jan 2005 14:56:43 - --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] K = K
Try adding the $OPTIONS EXT compiler directive to the top of the program. Ron White - Original Message - From: [EMAIL PROTECTED] To: u2-users@listserver.u2ug.org Sent: Thursday, January 20, 2005 8:56 AM Subject: RE: [U2] K = K I've just started at a new site running D3 7.2.1.RS on AIX and the REMOVE statement doesn't compile at all! It's very annoying as it's a very convenient way of processing dynamic arrays and with larger arrays far more efficient than counting the markers and FOR... NEXTing through it. I'm suprised that REMOVE isn't universal amongst U2 BASICs. Regards, Chris Bill writes - In UniData and D3 the REMOVE statement looks like: REMOVE variable FROM dynamic.array AT position.variable SETTING delimiter.variable This allows the explicit setting of the pointer, without resorting to reinitialization by reassigning the array variable. I've always just assigned Position.Variable prior to doing any REMOVE stuff. But then, UniVerse is sometimes a different animal. :-) Checked by MimeSweeper Thu, 20 Jan 2005 14:56:43 - --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- [ E-mail scanned Virus Free by NAI - McAfee anti-virus system ] --- [ E-mail scanned Virus Free by NAI - McAfee anti-virus system ] --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] K = K
REMOVE is universal in U2 BASICs. You are not using a U2 BASIC. According to your comment you are using D3 which is not a U2 product. [EMAIL PROTECTED] wrote: I've just started at a new site running D3 7.2.1.RS on AIX and the REMOVE statement doesn't compile at all! It's very annoying as it's a very convenient way of processing dynamic arrays and with larger arrays far more efficient than counting the markers and FOR... NEXTing through it. I'm suprised that REMOVE isn't universal amongst U2 BASICs. Regards, Chris Bill writes - In UniData and D3 the REMOVE statement looks like: REMOVE variable FROM dynamic.array AT position.variable SETTING delimiter.variable This allows the explicit setting of the pointer, without resorting to reinitialization by reassigning the array variable. I've always just assigned Position.Variable prior to doing any REMOVE stuff. But then, UniVerse is sometimes a different animal. :-) Checked by MimeSweeper Thu, 20 Jan 2005 14:56:43 - --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] K = K
I frequently see this type of line K = K in the code I work on and never understood why. Anyone care to share why this is ever needed? I only part way followed the comment in this program sample. Thanks, Marilyn A. Hilb Value Part, Inc Direct: 847-918-6099 Fax: 847-367-1892 [EMAIL PROTECTED] www.valuepart.com -Original Message- From: Andrea Charles [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 11:55 AM To: 'u2-users@listserver.u2ug.org' Subject:FW: [U2] UV-piopen TRANS function Do you need the K = K ? -- looks good, except how about something like: FUNCTION ATRANS( F,K,P,X ) REMOVE DUM FROM K SETTING MORE ; check for any delimiters K = K ; * reset rmv ptr in case calling pgm cares. T = TRANS(F,K,P,X) RETURN (IF MORE THEN T ELSE RAISE(T) ) or did I get the then-else backwards . . . cds --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] K = K
When using REMOVE to extract the values in a multi-valued variable in a sequential manner, an internal pointer is used to tell the system what value was last REMOVEd. Using K=K resets the pointer to the first value in the variable. HTH, Gordon Gordon J. Glorfield Sr. Applications Developer MAMSI (A UnitedHealth Company) 301-360-8839 [EMAIL PROTECTED] wrote on 01/19/2005 02:29:15 PM: I frequently see this type of line K = K in the code I work on and never understood why. Anyone care to share why this is ever needed? I only part way followed the comment in this program sample. Thanks, Marilyn A. Hilb Value Part, Inc Direct: 847-918-6099 Fax: 847-367-1892 [EMAIL PROTECTED] www.valuepart.com -Original Message- From:Andrea Charles [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 11:55 AM To: 'u2-users@listserver.u2ug.org' Subject: FW: [U2] UV-piopen TRANS function Do you need the K = K ? -- looks good, except how about something like: FUNCTION ATRANS( F,K,P,X ) REMOVE DUM FROM K SETTING MORE ; check for any delimiters K = K ; * reset rmv ptr in case calling pgm cares. T = TRANS(F,K,P,X) RETURN (IF MORE THEN T ELSE RAISE(T) ) [snip] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] K = K
Date: Wed, 19 Jan 2005 13:29:15 -0600 Marilyn Hilb [EMAIL PROTECTED] wrote: I frequently see this type of line K = K in the code I work on and never understood why. -Original Message- From: Andrea Charles [mailto:[EMAIL PROTECTED] Do you need the K = K ? -- ... (Code from Charles Stevenson) REMOVE DUM FROM K SETTING MORE ; check for any delimiters K = K ; * reset rmv ptr in case calling pgm cares. According to the UniData Help for REMOVE, in the code sample above, DUM would be set to the first string delimited by a standard delimiter (e.g., @AM, @VM), and MORE would be set to index the level of the delimiter encountered: 0=End of array, 1=Record Mark (255), [EMAIL PROTECTED] (254), [EMAIL PROTECTED] (253), etc. A pointer is maintained so that the next REMOVE X FROM K would return the next string. The comment is stating that the K = K is used to reset the REMOVE pointer to the beginning of the string. Further info on using REMOVE: REMOVE is useful for sequentially processing all the elements of a dynamic array without having to recount for each subsequent item. However, you need to check your delimiters to find attributes/values/subvalues. A similar method to process each attribute is to SELECT K TO KLIST and then READNEXT DUM FROM KLIST within a loop. --Tom Pellitieri Century Equipment Toledo, Ohio --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] K = K
Now that I think about this, K is the array being traversed? We simply remove the next attribute/value/subvalue in array K and assigning this value to DUM. For example: K = I^AM^HAPPY]TO]READ^THIS^LIST REMOVE DUM FROM K SETTING MORE would result in: DUM = I K= the above array MORE = 2 However, (from the documentation), the pointer is reset to the beginning of dynamic.array whenever dynamic.array is reassigned. Therefore, dynamic.array should not be assigned a new value until all elements have been extracted (that is, until variable = 0). So, the line K=K simply reassigns the array to itself, thus resetting the pointer. In UniData and D3 the REMOVE statement looks like: REMOVE variable FROM dynamic.array AT position.variable SETTING delimiter.variable This allows the explicit setting of the pointer, without resorting to reinitialization by reassigning the array variable. I've always just assigned Position.Variable prior to doing any REMOVE stuff. But then, UniVerse is sometimes a different animal. :-) Bill -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Wednesday, January 19, 2005 1:22 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] K = K Date: Wed, 19 Jan 2005 13:29:15 -0600 Marilyn Hilb [EMAIL PROTECTED] wrote: I frequently see this type of line K = K in the code I work on and never understood why. -Original Message- From: Andrea Charles [mailto:[EMAIL PROTECTED] Do you need the K = K ? -- ... (Code from Charles Stevenson) REMOVE DUM FROM K SETTING MORE ; check for any delimiters K = K ; * reset rmv ptr in case calling pgm cares. According to the UniData Help for REMOVE, in the code sample above, DUM would be set to the first string delimited by a standard delimiter (e.g., @AM, @VM), and MORE would be set to index the level of the delimiter encountered: 0=End of array, 1=Record Mark (255), [EMAIL PROTECTED] (254), [EMAIL PROTECTED] (253), etc. A pointer is maintained so that the next REMOVE X FROM K would return the next string. The comment is stating that the K = K is used to reset the REMOVE pointer to the beginning of the string. Further info on using REMOVE: REMOVE is useful for sequentially processing all the elements of a dynamic array without having to recount for each subsequent item. However, you need to check your delimiters to find attributes/values/subvalues. A similar method to process each attribute is to SELECT K TO KLIST and then READNEXT DUM FROM KLIST within a loop. --Tom Pellitieri Century Equipment Toledo, Ohio --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/