RE: [U2] Is a dynamic array "empty" or not?
> From: Ray Wurlod > Len(Convert(@AM:@VM:" ", "", DynamicArray)) = 0 Exactly. Len(X) is cheaper than (X=""). Furthermore, since all parts of the double concatenation @AM:@VM:" " are constants, both those operations get evaluated by the compiler and the single hardcoded resultant string makes it into the object code. So there aren't runtime concatenation operations. This is true for UV Basic compiler, but not for I-descriptors. Don't know about UD. For that matter, the EQ operation in Len(...) = 0 may be unnecessary since Len(...) can be treated as either true or false all by iteslf. Sure, hardware is cheap, but you might as well be efficient when there's no downside. cds --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Is a dynamic array "empty" or not?
Hi Wendy, If you remove @AM, @VM, and spaces by changing them to null values with the CONVERT function, then if the variable has anything left in it, you have a non-empty value. JUNK=TEST.1 CONVERT @AM:@VM:" " TO "" IN JUNK IF LEN(JUNK) GT 0 THEN PRINT "TEST.1 IS NOT 'EMPTY'" END ELSE PRINT "TEST.1 IS 'EMPTY'" END Just be sure to use a "junk" variable and don't CONVERT the actual variable. HTH, BobW -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wendy Smoak Sent: Wednesday, February 01, 2006 9:19 AM To: u2-users@listserver.u2ug.org Subject: [U2] Is a dynamic array "empty" or not? I'm probably missing something obvious here... What can I use to evaluate the "emptiness" of these arrays, so that 1 and 2 are considered empty and 3 is not? TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM Thanks! Wendy Smoak --- 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] Is a dynamic array "empty" or not?
Len(Convert(@AM:@VM:" ", "", DynamicArray)) = 0 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Is a dynamic array "empty" or not?
Hmmm... That leads to an interesting idea. If you consider a space to be 'something', then test.1 is really the only 'empty' array, and the following would work, without doing any trims or conversions: IF SUM(SUM(NES(TEST.x,REUSE('' THEN (string is not empty) You could also make it work, considering spaces to be empty by amending it thusly: IF SUM(SUM(NES(CONVERT(' ','',TEST.x),REUSE('' THEN (string is not empty) Remember: eschew obfuscation ;-) Larry Hiscock Western Computer Services -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of john reid Sent: Wednesday, February 01, 2006 10:39 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Is a dynamic array "empty" or not? Me too, 'cause TEST.2 isnt empty I dont think. Unless blanks are not 'something' I always use EQS or NES functions for evaluation. Just make an array using the same delimiters, and say TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM XYZ=EQS(TEST.1,TEST.3) CRT XYZ 1}1~0}0}1~0~1 OR... am I missing something? j On 2/1/06, Wendy Smoak <[EMAIL PROTECTED]> wrote: > I'm probably missing something obvious here... > What can I use to evaluate the "emptiness" of these arrays, so that 1 > and 2 are considered empty and 3 is not? > > TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM > TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM > TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM > > Thanks! > Wendy Smoak > --- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ > -- john --- 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] Is a dynamic array "empty" or not?
Here's what we came up with, just for fun: IF SUM(NOTS(NOTS(TRIMS(REPORT.DATA<2> THEN CRT 'Not empty!' The TRIM(CONVERT(...)) answer would work as well, I think. I don't want to change the value of the array-- if it's not empty, I need to print it. (UniData, BTW, sorry I didn't mention it. And the values that contain only spaces should be considered empty.) Thanks, -- Wendy --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Is a dynamic array "empty" or not?
Me too, 'cause TEST.2 isnt empty I dont think. Unless blanks are not 'something' I always use EQS or NES functions for evaluation. Just make an array using the same delimiters, and say TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM XYZ=EQS(TEST.1,TEST.3) CRT XYZ 1}1~0}0}1~0~1 OR... am I missing something? j On 2/1/06, Wendy Smoak <[EMAIL PROTECTED]> wrote: > I'm probably missing something obvious here... > What can I use to evaluate the "emptiness" of these arrays, so that 1 > and 2 are considered empty and 3 is not? > > TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM > TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM > TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM > > Thanks! > Wendy Smoak > --- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ > -- john --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Is a dynamic array "empty" or not?
On Wednesday 01 February 2006 12:19, Wendy Smoak wrote: > I'm probably missing something obvious here... > What can I use to evaluate the "emptiness" of these arrays, so that 1 > and 2 are considered empty and 3 is not? > >TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM >TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM >TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM The brute force way: X = TEST.1 CONVERT @AM:@SM:@VM:@FM:@TM:' ' TO '' IN X IF LEN(X) > 0 THEN ... -- Jeff Butera, Ph.D. Administrative Systems Hampshire College [EMAIL PROTECTED] 413-559-5556 "Hindsight alone is not wisdom." George W. Bush --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Is a dynamic array "empty" or not?
How 'bout IF TRIM(CONVERT(@AM:@VM,'',TEST.1)) = '' THEN Bruce M Neylon Health Care Management Group Wendy Smoak <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 02/01/2006 12:19 PM Please respond to u2-users@listserver.u2ug.org To u2-users@listserver.u2ug.org cc Subject [U2] Is a dynamic array "empty" or not? I'm probably missing something obvious here... What can I use to evaluate the "emptiness" of these arrays, so that 1 and 2 are considered empty and 3 is not? TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM Thanks! Wendy Smoak --- 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] Is a dynamic array "empty" or not?
On Wed, Feb 01, 2006 at 10:19:00AM -0700, Wendy Smoak wrote: > I'm probably missing something obvious here... > What can I use to evaluate the "emptiness" of these arrays, so that 1 > and 2 are considered empty and 3 is not? > >TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM >TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM >TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM Couldn't you do a convert(@FM:@VM:@SM:@AM:' ','') on them and see if they're null? --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Is a dynamic array "empty" or not?
You didn't specify UD or UV, but this should work (in UD at least): IF TRIM(CONVERT(@AM:@VM:@SM,"",TEST.x)) EQ "" THEN ... The array is "empty" Larry Hiscock Western Computer Sevices -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wendy Smoak Sent: Wednesday, February 01, 2006 9:19 AM To: u2-users@listserver.u2ug.org Subject: [U2] Is a dynamic array "empty" or not? I'm probably missing something obvious here... What can I use to evaluate the "emptiness" of these arrays, so that 1 and 2 are considered empty and 3 is not? TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM Thanks! Wendy Smoak --- 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] Is a dynamic array "empty" or not?
> What can I use to evaluate the "emptiness" of these arrays, so that 1 > and 2 are considered empty and 3 is not? > >TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM >TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM >TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM Try something that removes all the "ignored" characters such as: IF CONVERT(@AM:@VM:' ', '', item) = '' THEN ... Martin Phillips Ladybridge Systems 17b Coldstream Lane, Hardingstone, Northampton NN4 6DB +44-(0)1604-709200 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Is a dynamic array "empty" or not?
CONVERT @VM TO '' IN TEST.1 CONVERT @AM TO '' IN TEST.1 IF TEST.1 NE "" THEN .. etc Wendy Smoak wrote: I'm probably missing something obvious here... What can I use to evaluate the "emptiness" of these arrays, so that 1 and 2 are considered empty and 3 is not? TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM Thanks! Wendy Smoak --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ -- Richard A. Wilson Lakeside Systems --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
[U2] Is a dynamic array "empty" or not?
I'm probably missing something obvious here... What can I use to evaluate the "emptiness" of these arrays, so that 1 and 2 are considered empty and 3 is not? TEST.1 = @VM:@AM:@VM:@VM:@AM:@AM TEST.2 = @VM:@AM:' ':@VM:' ':@VM:@AM:' ':@AM TEST.3 = @VM:@AM:' ':@VM:'zzz':@VM:@AM:'abc':@AM Thanks! Wendy Smoak --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/