Re: [U2] What is true

2013-08-02 Thread Wjhonson
@listserver.u2ug.org Sent: Thu, Aug 1, 2013 11:16 am Subject: Re: [U2] What is true Hi again, I have been on a site where they insisted that A = B = C should be written as A = B EQ C to emphasise that the second operator is a relational test. Personally, I use A = (B = C) even though

Re: [U2] What is true

2013-08-02 Thread Kevin King
understanding what your code is doing that is time well worth spent -Original Message- From: Martin Phillips martinphill...@ladybridge.com To: 'U2 Users List' u2-users@listserver.u2ug.org Sent: Thu, Aug 1, 2013 11:16 am Subject: Re: [U2] What is true Hi again, I have been

Re: [U2] What is true

2013-08-01 Thread Brian Leach
To clarify In multivalue, True is not False, where False is anything that is 'falsy' i.e. zero or empty. Obviously different than other languages, notably those where true is -1 (all bits set on a signed integer). So: A = HELLO IF A THEN CRT A : WORLD Gives HELLO WORLD Regarding file

Re: [U2] What is true

2013-08-01 Thread Tom Whitmore
- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Brian Leach Sent: Thursday, August 01, 2013 4:40 AM To: 'U2 Users List' Subject: Re: [U2] What is true To clarify In multivalue, True is not False, where False is anything that is 'falsy

Re: [U2] What is true

2013-08-01 Thread Jim Swain
To: U2 Users List Subject: Re: [U2] What is true Hi, To add a little more to the discussion. I know in UniVerse this is true and I suspect it is true in other flavors of Pick. If you wrap a variable in parenthesis it will be treated as a Boolean test. For example: A='' IF (A) THEN CRT 'TRUE

Re: [U2] What is true

2013-08-01 Thread Brian Leach
...@listserver.u2ug.org] On Behalf Of Jim Swain Sent: 01 August 2013 13:24 To: U2 Users List Subject: Re: [U2] What is true This is not true as when A='HELLO' IF (A) returns true. You use the parenthesis to set a Boolean variable, i.e BRITISH = (COUNTRY = 'ENGLAND' OR COUNTRY = 'WALES') etc the var BRITISH is set

Re: [U2] What is true

2013-08-01 Thread Ed Clark
Business Solutions -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Brian Leach Sent: Thursday, August 01, 2013 4:40 AM To: 'U2 Users List' Subject: Re: [U2] What is true To clarify In multivalue, True

Re: [U2] What is true

2013-08-01 Thread Ed Clark
on universe (not sure of unidata), you can use FILEINFO() to see if something is a file variable: x= crt fileinfo(x,0) returns 0. Would return 1 for an open file. On Jul 31, 2013, at 4:47 PM, Wols Lists antli...@youngman.org.uk wrote: On 31/07/13 09:06, Martin Phillips wrote: Of course,

Re: [U2] What is true

2013-08-01 Thread Martin Phillips
Lane, Hardingstone, Northampton NN4 6DB, England +44 (0)1604-709200 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Ed Clark Sent: 01 August 2013 14:41 To: U2 Users List Subject: Re: [U2] What is true Do people

Re: [U2] What is true

2013-08-01 Thread Martin Phillips
on universe (not sure of unidata), you can use FILEINFO() to see if something is a file variable: x= crt fileinfo(x,0) returns 0. Would return 1 for an open file. This originated in Prime Information and is available on UniVerse, UniData, PI/open, QM, and probably a few others. Martin

Re: [U2] What is true

2013-08-01 Thread Tom Whitmore
-Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Jim Swain Sent: Thursday, August 01, 2013 8:24 AM To: U2 Users List Subject: Re: [U2] What is true This is not true as when A='HELLO' IF (A) returns true. You use

Re: [U2] What is true

2013-08-01 Thread Martin Braid
:52 To: U2 Users List Subject: Re: [U2] What is true Here is a simple program I wrote and ran on UV 11.1.9. It would be interesting to hear if UD behaves the same way. 0001: A='' 0002: CRT 'A = ':QUOTE(A):' ': 0003: IF (A) THEN CRT 'TRUE' ELSE CRT 'FALSE' 0004: A=0 0005: CRT 'A = ':QUOTE

Re: [U2] What is true

2013-08-01 Thread Ed Clark
- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Ed Clark Sent: 01 August 2013 14:41 To: U2 Users List Subject: Re: [U2] What is true Do people from Wales take well to being called British? Sadly, almost everything I know about Wales

Re: [U2] What is true

2013-08-01 Thread Ed Clark
on universe, it looks like only fileinfo(var,0) will let you test. fileinfo(var,1) etc will abort complaining that var isn't a file variable On Aug 1, 2013, at 9:52 AM, Martin Phillips martinphill...@ladybridge.com wrote: on universe (not sure of unidata), you can use FILEINFO() to see if

Re: [U2] What is true

2013-08-01 Thread Tony Gravagno
Fascinating stuff. :) I don't like the idea of spaces being numeric but when I get data from unknown sources I do tend to TRIM and test for NUM(x). With the following program: - Universe in Information flavor reports True on all tests. - Unidata only reports 3-8 as True - D3 does not consider any

Re: [U2] What is true

2013-08-01 Thread Tony Gravagno
Just adding a little more subtlety. Consider: X = Y = 3 In some languages this sets Y to 3 and then X to Y, so X=3. But in BASIC, as Brian said, we need to force the precedence on Y=3 before X=Y. In other contexts, parentheses force an equation. Consider: SUBROUTINE FOO( X,Y,Z ) and CALL FOO(

Re: [U2] What is true

2013-08-01 Thread Jim Swain
contact postmas...@zafire.com -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Tony Gravagno Sent: 01 August 2013 17:34 To: u2-users@listserver.u2ug.org Subject: Re: [U2] What is true Just adding a little more subtlety

Re: [U2] What is true

2013-08-01 Thread Brian Leach
Which is why I used it in my response. Brian -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Ed Clark Sent: 01 August 2013 17:10 To: U2 Users List Subject: Re: [U2] What is true on universe, it looks like only

Re: [U2] What is true

2013-08-01 Thread Brian Leach
...@listserver.u2ug.org] On Behalf Of Jim Swain Sent: 01 August 2013 17:46 To: U2 Users List Subject: Re: [U2] What is true Now I'm getting confused... its not a case of precedence In the case of X = Y = 3 X is set to 1 (true) when Y = 3 X is set to 0 (false) when Y # 3 X in this instance will never = 3

Re: [U2] What is true

2013-08-01 Thread Tony Gravagno
You're right. X is never 3, but I did say so. As I said below, that's the way it works in languages other than BASIC. X=Y=3 will set both values to 3 because of the order of operations. And I was wrong when I said we Need to force precedence. It doesn't Need to be forced in BASIC, but in other

Re: [U2] What is true

2013-08-01 Thread Martin Phillips
Hi again, I have been on a site where they insisted that A = B = C should be written as A = B EQ C to emphasise that the second operator is a relational test. Personally, I use A = (B = C) even though the brackets serve no purpose. It just helps when reading the code. Martin Phillips

Re: [U2] What is true

2013-08-01 Thread Wols Lists
On 01/08/13 17:10, Ed Clark wrote: on universe, it looks like only fileinfo(var,0) will let you test. fileinfo(var,1) etc will abort complaining that var isn't a file variable Which is why I think the UV implementation is CRAP! You should not be able to *crash* your program simply by

Re: [U2] What is true

2013-08-01 Thread Wols Lists
On 01/08/13 19:15, Martin Phillips wrote: Hi again, I have been on a site where they insisted that A = B = C should be written as A = B EQ C to emphasise that the second operator is a relational test. A lot of fellow coders have wondered at it, but as someone who learnt coding in

Re: [U2] What is true

2013-08-01 Thread Daniel McGrath
easier. Cheers, Dan -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wols Lists Sent: Thursday, August 01, 2013 12:48 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] What is true On 01/08/13 17:10, Ed Clark

Re: [U2] What is true

2013-08-01 Thread Sammartino, Richard
To further complicate things, I was instructed at one job to use the IF VAR THEN syntax as this was treated a boolean operation and executed faster than IF VAR # ''. We were working on Prime Information at the time. A few years later I went to work for a VAR. I had made changes to the their

Re: [U2] What is true

2013-08-01 Thread Kevin King
Martin, that's actually one of my standards. Due to the ambiguity of several characters, most notably , , and =, we use EQ, NE, LT, LE, GT, and GE for comparison and use for array extraction and replacement and = for assignment. Except in SB+, which doesn't allow such critters. And kudos for

Re: [U2] What is true

2013-07-31 Thread Martin Phillips
Hi, About the true/false thing, I always use 0 and 1 but I was chastised about that by a colleague recently, that it might not be completely cross-platform, and now I stutter on it every time I do that, wondering if I'm not really following a best practice I seem to recall this same topic

Re: [U2] What is true

2013-07-31 Thread Charles Stevenson
And then there's the query language: Suppose INVOICED field is supposed to be true or false. Stored as 1 or 0, but maybe left null in some records (We've all been there.): SELECT CUSTOMER WITH INVOICED If INVOICED is 0 or null, will said CUSTOMER record be selected or not? UV selects

Re: [U2] What is true

2013-07-31 Thread Martin Phillips
, Hardingstone, Northampton NN4 6DB, England +44 (0)1604-709200 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Charles Stevenson Sent: 31 July 2013 11:46 To: U2 Users List Subject: Re: [U2] What is true And then there's

Re: [U2] What is true

2013-07-31 Thread Larry Hiscock
Of Charles Stevenson Sent: Wednesday, July 31, 2013 3:46 AM To: U2 Users List Subject: Re: [U2] What is true And then there's the query language: Suppose INVOICED field is supposed to be true or false. Stored as 1 or 0, but maybe left null in some records (We've all been there.): SELECT

Re: [U2] What is true

2013-07-31 Thread Kevin King
Services -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Charles Stevenson Sent: Wednesday, July 31, 2013 3:46 AM To: U2 Users List Subject: Re: [U2] What is true And then there's the query language: Suppose

Re: [U2] What is true

2013-07-31 Thread Wols Lists
On 31/07/13 09:06, Martin Phillips wrote: Of course, nothing is ever completely black and white. As multivalue Basic has developed, internal data types have gone beyond simply numbers and strings. If I write IF FVAR THEN ... where FVAR is a file variable, what do I expect this to do? The

Re: [U2] What is true

2013-07-31 Thread Wjhonson
at once. -Original Message- From: Wols Lists antli...@youngman.org.uk To: u2-users u2-users@listserver.u2ug.org Sent: Wed, Jul 31, 2013 1:48 pm Subject: Re: [U2] What is true On 31/07/13 09:06, Martin Phillips wrote: Of course, nothing is ever completely black and white. As multivalue

Re: [U2] What is true

2013-07-31 Thread Keith Johnson [DATACOM]
Hi Wil, That indeed was my code - ten years old now! I think I read the same article as Kevin. I don't use it in my day to day programming (which is in Universe and QM, thus using @TRUE and @FALSE) but I think I still would use it for Pickwiki. Just a style thing - de gustibus non disputandum

Re: [U2] What is true

2013-07-31 Thread Tony Gravagno
From: Keith Johnson Hi Tony, 'Twas a teensy bug under an unusual circumstance... Hey, wait a minute, you're the one who complained that no-one updated other people's code! You wouldn't be trying to yank Will's chain, would you? Indeed I do comment occasionally on the proportion of takers to

Re: [U2] What is true

2013-07-30 Thread Kevin King
I picked up that trick from some old code may years ago, and haven't used it in a while since @TRUE and @FALSE have been available on Unidata and Universe, but you may be seeing some of my old code. As far as I have seen, TRUE is usually 1 on MV platforms, but at the time I started writing that

Re: [U2] What is true

2013-07-30 Thread Wjhonson
I saw it here by KRJ whoever that is http://www.pickwiki.com/cgi-bin/wiki.pl?Compare -Original Message- From: Kevin King ke...@precisonline.com To: U2 Users List u2-users@listserver.u2ug.org Sent: Tue, Jul 30, 2013 6:10 pm Subject: Re: [U2] What is true I picked up

Re: [U2] What is true

2013-07-30 Thread Tony Gravagno
From: Wjhonson I saw it here by KRJ whoever that is http://www.pickwiki.com/cgi-bin/wiki.pl?Compare That's Keith Johnson in NZ. What an unusual last name... ;) Ironically, it looks like he recently modified one of your postings to PickWiki too. About the true/false thing, I always use 0 and

Re: [U2] What is true

2013-07-30 Thread Kevin King
For me it was more of a concern when there were new players entering the market. As we haven't really seen any new MV platforms in a good long while it seems like this is much less of a concern. On Tue, Jul 30, 2013 at 9:21 PM, Tony Gravagno 3xk547...@sneakemail.comwrote: From: Wjhonson I