RE: [U2] Deciphering Pick UniBasic statement

2005-12-11 Thread Jacques G.
 Caleb's. It could take days to unravel the code by
 hand versus the few
 minutes needed to send it out to www.srs4uv.com.

From one horror story I read on the site about a
programmer that had sabotaged source code:

The company used the SRS on the object code they were
running. In addition, they compiled the suspect source
code and used the SRS on that set. By comparing the
two source code result sets they figured out which
programs had been sabotaged.

Why not simply compare the binaries ?  Unix has a
small program called: cmp that can compare two files
and Windows has comp.
You can tell which ones have been changed that way. 

You can also know when the files were last compiled by
looking at the dates with ls -al on the binary.  

Still I think the decompiler can be a useful tool. 
I've worked with a client who purchased a package some
years back and they only have the binaries.  If the
supplier ever goes out of business they are in
trouble.


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Deciphering Pick UniBasic statement

2005-12-11 Thread Mark Johnson
snip
 I've worked with a client who purchased a package some
 years back and they only have the binaries.  If the
 supplier ever goes out of business they are in
 trouble.
/snip

I must offer my opinion here on VAR-delivered object-code only systems.

If I had any say in such a situation, I would require that the VAR place the
source code that matches my purchased (licensed) system in escrow or some
3rd party place. I've run into a few prospective client situations that I
could not turn into actual clients as I had nothing to work with.

When the relationship is active or current, it's a nice deal for both the
VAR and the client. The client gets current updates etc and the VAR has a
locked in client. But when the VAR goes out of business, the client has a
system with no source code and eventually it screws the entire MV community
as in all of my examples, the replacement system wasn't MV-based.

I don't want to digress into a debate on the merits of software licensing
etc. That gets too out of hand. But when a VAR goes out of business and
leaves no source code behind. No-one wins.

Perhaps anyone in this current situation should re-negotiate the terms of
their relationship with an application VAR who doesn't provide the source
code. Otherwise, if the VAR folds, you're screwed.

One VAR pulling a similar deceitful move removed from all of the
dictionaries those dict items that weren't part of any English reports or
Select statements. Think about it, if field 39 is used only in data/basic
programs, it really doesn't need to have a dict item to work. I've spent
many hours (and my client's $) backfilling missing dict items from source
code.

Likewise for source code with comments removed. If this were 1984 we would
all have to play it a little closer. But it's 2005 and we should stick
together because it really is MV versus other databases and not UD versus UV
or MCD vs ULT or ADDS vs Sanyo etc. United we stand..

My 2 cents.
Mark Johnson



- Original Message -
From: Jacques G. [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Sunday, December 11, 2005 11:31 AM
Subject: RE: [U2] Deciphering Pick UniBasic statement


  Caleb's. It could take days to unravel the code by
  hand versus the few
  minutes needed to send it out to www.srs4uv.com.

 From one horror story I read on the site about a
 programmer that had sabotaged source code:

 The company used the SRS on the object code they were
 running. In addition, they compiled the suspect source
 code and used the SRS on that set. By comparing the
 two source code result sets they figured out which
 programs had been sabotaged.

 Why not simply compare the binaries ?  Unix has a
 small program called: cmp that can compare two files
 and Windows has comp.
 You can tell which ones have been changed that way.

 You can also know when the files were last compiled by
 looking at the dates with ls -al on the binary.

 Still I think the decompiler can be a useful tool.



 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com
 ---
 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] Deciphering Pick UniBasic statement

2005-12-10 Thread Gyle Iverson
Hello, Charles.

Charles Stevenson wrote...
I have not had occasion to use the srs4uv.com decompiler service.
Probably worth the price when you really need it.

It can be. Just imagine programs with hundreds of lines of code like
Caleb's. It could take days to unravel the code by hand versus the few
minutes needed to send it out to www.srs4uv.com.

I am thankful for the wonderful www.srs4uv.com freebie download,
SRS.UV.HEADER, that allows access to info about the object file from an
I-descriptor subroutine.

Thank you for the comments. I am glad to hear you like it.

Best regards,
Gyle

P.S. I corrected the web address and the program name.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-10 Thread Dan Fitzgerald
In addition to vlist, if you have the truss command (AIX has it), you can 
see the system calls as they are made. You need a copy of Steven's Advanced 
Programming in the UNIX Environment handy to decipher it, though (there are 
a couple of exceptions on this list; people who actually can read this stuff 
on the fly. Frightening.).




Our greatest duty in this life is to help others. And please, if you can't 
help them, could you at least not hurt them? - H.H. the Dalai Lama
When buying  selling are controlled by legislation, the first thing to be 
bought  sold are the legislators - P.J. O'Rourke

Dan Fitzgerald






From: Stevenson, Charles [EMAIL PROTECTED]
Reply-To: u2-users@listserver.u2ug.org
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Deciphering Pick UniBasic statement
Date: Sat, 10 Dec 2005 01:32:08 -0500

I have not had occasion to use the src4uv.com decompiler service.
Probably worth the price when you really need it.

I am thankful for the wonderful www.src4uv.com freebie download,
SRC.UV.HEADER, that allows access to info about the object file from an
I-descriptor subroutine.

Besides VLIST, but similar to it, RAID has the I  X commands that could
be useful when trying to understand EXACTLY what the program is doing:
  X Displays the current object code instruction and address.
  I Displays and executes the next object code instruction.

cds

 From: Gyle Iverson

 Hello, Charles.

 Charles Stevenson wrote...
 Everyone's going to jump in with the answer, but here's a
 way to figure
 it out yourself (on UV, but not UD): Use VLIST.

 I don't know which is more painful, the original code or the
 VLIST output.
 ;-) I decompiled Caleb's code using the srs4uv.com decompiler
 and got the following result in under a second. A few
 customers use the SRS recovery service for just this reason.

 IF P(2) - AR(12) = 28 THEN
CC += 1
INS 0 BEFORE AR(14)1, 1
DEL AR(14)1, 9
 END ELSE
IF AR(13) = DATE() THEN
   CC = CC
END ELSE
   INS 1 BEFORE AR(14)1, 1
   DEL AR(14)1, 9
END
 END

 Best regards,
 Gyle
 www.srs4uv.com
---
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] Deciphering Pick UniBasic statement

2005-12-09 Thread Brian Leach
Caleb,

Just to point out - as a newbie don't think all MV coding is like this!
It's this sort of rubbish that gives our industry a bad name.

(Mind you I've seen worse C++ code...)

:)

Brian 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Caleb Ng
 Sent: 08 December 2005 21:26
 To: u2-users@listserver.u2ug.org
 Subject: RE: [U2] Deciphering Pick UniBasic statement
 
 The general consensus of replies confirms my findings of how 
 this was originally meant to be nested.  Thanks for all your help.
 
 Caleb
 
  [EMAIL PROTECTED] 12/08/05 12:09PM 
 IF P(2)-AR(12)=28 THEN  
CC=CC+1   
INS 0 BEFORE AR(14)1,1  
DEL AR(14)1,9   
 END ELSE 
IF AR(13)=DATE() THEN 
   CC=CC ELSE INS 1 BEFORE AR(14)1,1
   DEL AR(14)1,9
END   
 END  
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Deciphering Pick UniBasic statement

2005-12-09 Thread Jerry Banker

Actually it looks like some case tool code to me not a programmers code.

- Original Message - 
From: Brian Leach [EMAIL PROTECTED]

To: u2-users@listserver.u2ug.org
Sent: Friday, December 09, 2005 3:01 AM
Subject: RE: [U2] Deciphering Pick UniBasic statement



Caleb,

Just to point out - as a newbie don't think all MV coding is like this!
It's this sort of rubbish that gives our industry a bad name.

(Mind you I've seen worse C++ code...)

:)

Brian 


-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Caleb Ng

Sent: 08 December 2005 21:26
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Deciphering Pick UniBasic statement

The general consensus of replies confirms my findings of how 
this was originally meant to be nested.  Thanks for all your help.


Caleb

 [EMAIL PROTECTED] 12/08/05 12:09PM 
IF P(2)-AR(12)=28 THEN  
   CC=CC+1   
   INS 0 BEFORE AR(14)1,1  
   DEL AR(14)1,9   
END ELSE 
   IF AR(13)=DATE() THEN 
  CC=CC ELSE INS 1 BEFORE AR(14)1,1
  DEL AR(14)1,9
   END   
END  

---
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] Deciphering Pick UniBasic statement

2005-12-09 Thread Gyle Iverson
Hello, Charles.

Charles Stevenson wrote...
Everyone's going to jump in with the answer, but here's a way to figure
it out yourself (on UV, but not UD): Use VLIST.

I don't know which is more painful, the original code or the VLIST output.
;-) I decompiled Caleb's code using the srs4uv.com decompiler and got the
following result in under a second. A few customers use the SRS recovery
service for just this reason.

IF P(2) - AR(12) = 28 THEN
   CC += 1
   INS 0 BEFORE AR(14)1, 1
   DEL AR(14)1, 9
END ELSE
   IF AR(13) = DATE() THEN
  CC = CC
   END ELSE
  INS 1 BEFORE AR(14)1, 1
  DEL AR(14)1, 9
   END
END 

Best regards,
Gyle
www.srs4uv.com
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-09 Thread Stevenson, Charles
I have not had occasion to use the src4uv.com decompiler service.
Probably worth the price when you really need it.

I am thankful for the wonderful www.src4uv.com freebie download,
SRC.UV.HEADER, that allows access to info about the object file from an
I-descriptor subroutine.

Besides VLIST, but similar to it, RAID has the I  X commands that could
be useful when trying to understand EXACTLY what the program is doing:
  X Displays the current object code instruction and address.
  I Displays and executes the next object code instruction.

cds

 From: Gyle Iverson
 
 Hello, Charles.
 
 Charles Stevenson wrote...
 Everyone's going to jump in with the answer, but here's a 
 way to figure 
 it out yourself (on UV, but not UD): Use VLIST.
 
 I don't know which is more painful, the original code or the 
 VLIST output.
 ;-) I decompiled Caleb's code using the srs4uv.com decompiler 
 and got the following result in under a second. A few 
 customers use the SRS recovery service for just this reason.
 
 IF P(2) - AR(12) = 28 THEN
CC += 1
INS 0 BEFORE AR(14)1, 1
DEL AR(14)1, 9
 END ELSE
IF AR(13) = DATE() THEN
   CC = CC
END ELSE
   INS 1 BEFORE AR(14)1, 1
   DEL AR(14)1, 9
END
 END 
 
 Best regards,
 Gyle
 www.srs4uv.com
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-08 Thread Jim Koca
Think of ; as a CR/LF - separate line of code. Hope this helps 

 IF P(2)-AR(12)=28 THEN
  CC=CC+1
  INS 0 BEFORE AR(14)1,1
  DEL AR(14)1,9
 END ELSE
  IF AR(13)=DATE() THEN
   CC=CC 
  END ELSE
   INS 1 BEFORE AR(14)1,1
   DEL AR(14)1,9
  END
 END


Jim

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Caleb Ng
 Sent: Thursday, December 08, 2005 1:11 PM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Deciphering Pick UniBasic statement
 
 
 I'm trying to decipher and break the following IF/THEN/ELSE statement
 into multiple lines because I need to add some logic into it.   Being a
 PICK newbie, I'm having difficulty understanding it.  I believe this
 code was ported from an old MD Pick system but I want to make sure it
 behaves in a similar fashion once I break it apart.  I'm sure this will
 be no problem to gurus like yourselves.
 
 IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
 AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
 AR(14)1,1; DEL AR(14)1,9
 
 Thanks in advance,
 
 
 Caleb Ng
 Systems Analyst
 Sweetwater Authority
 [EMAIL PROTECTED]
 (619) 409-6763
 ---
 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] Deciphering Pick UniBasic statement

2005-12-08 Thread Ron Hutchings

IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9

Here is my interpretation:

IF P(2)-AR(12)=28 THEN
   CC=CC+1
   INS 0 BEFORE AR(14)1,1
   DEL AR(14)1,9
END ELSE
IF AR(13)=DATE() THEN
CC=CC
END ELSE
INS 1 BEFORE AR(14)1,1
DEL AR(14)1,9
 END
END

Good Luck!
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-08 Thread Larry Hiscock
First thing I would do is indent it to make it readable.  This is the way I
see it:

IF P(2)-AR(12)=28 THEN 
   CC=CC+1
   INS 0 BEFORE AR(14)1,1
   DEL AR(14)1,9
END ELSE 
   IF AR(13)=DATE() THEN 
  CC=CC 
   END ELSE 
  INS 1 BEFORE AR(14)1,1
  DEL AR(14)1,9 
   END
END

Larry Hiscock
Western Computer Services


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Caleb Ng
Sent: Thursday, December 08, 2005 1:11 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Deciphering Pick UniBasic statement

I'm trying to decipher and break the following IF/THEN/ELSE statement
into multiple lines because I need to add some logic into it.   Being a
PICK newbie, I'm having difficulty understanding it.  I believe this
code was ported from an old MD Pick system but I want to make sure it
behaves in a similar fashion once I break it apart.  I'm sure this will
be no problem to gurus like yourselves.

IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9

Thanks in advance,


Caleb Ng
Systems Analyst
Sweetwater Authority
[EMAIL PROTECTED]
(619) 409-6763
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/195 - Release Date: 12/8/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/195 - Release Date: 12/8/2005
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-08 Thread u2
My god, who would write a line of basic code like that? Must have been a
former MUMPS programmer.

IF P(2)-AR(12)=28 THEN 
  CC=CC+1
  INS 0 BEFORE AR(14)1,1
  DEL AR(14)1,9
END ELSE IF AR(13)=DATE() THEN 
  CC=CC  ---huh?
END ELSE 
  INS 1 BEFORE AR(14)1,1
  DEL AR(14)1,9
END

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Caleb Ng
 Sent: Thursday, December 08, 2005 2:11 PM
 To: u2-users@listserver.u2ug.org
 Subject: [U2] Deciphering Pick UniBasic statement
 
 
 I'm trying to decipher and break the following IF/THEN/ELSE statement
 into multiple lines because I need to add some logic into it. 
   Being a
 PICK newbie, I'm having difficulty understanding it.  I 
 believe this code was ported from an old MD Pick system but I 
 want to make sure it behaves in a similar fashion once I 
 break it apart.  I'm sure this will be no problem to gurus 
 like yourselves.
 
 IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; 
 DEL AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 
 BEFORE AR(14)1,1; DEL AR(14)1,9
 
 Thanks in advance,
 
 
 Caleb Ng
 Systems Analyst
 Sweetwater Authority
 [EMAIL PROTECTED]
 (619) 409-6763
 ---
 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] Deciphering Pick UniBasic statement

2005-12-08 Thread Timothy Snyder
Caleb Ng [EMAIL PROTECTED] wrote on 12/08/2005 02:10:32 PM:

 IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
 AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
 AR(14)1,1; DEL AR(14)1,9

OK, this is some kind of test, right? Nobody actually put that mess in
production code, did they? Actually, it's unfortunately not the worst thing
I've ever seen. Anyway, here's my take on it.

IF P(2)-AR(12) LE 28 THEN
  CC = CC+1
  INS 0 BEFORE AR(14)1,1
  DEL AR(14)1,9
END ELSE
  IF AR(13) NE DATE() THEN
INS 1 BEFORE AR(14)1,1
DEL AR(14)1,9
  END
END

I changed the second compare to not equal, since the equal condition is
just assigning CC to itself. The only time I've seen that do anything
useful was when playing with REMOVE variables, which doesn't seem to be the
case here.


Tim Snyder
Consulting I/T Specialist , U2 Professional Services
North American Lab Services
DB2 Information Management, IBM Software Group
717-545-6403
[EMAIL PROTECTED]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Deciphering Pick UniBasic statement

2005-12-08 Thread Richard Brown
- Original Message - 
From: Caleb Ng [EMAIL PROTECTED]
To: u2-users@listserver.u2ug.org
Sent: Thursday, December 08, 2005 2:10 PM
Subject: [U2] Deciphering Pick UniBasic statement


 I'm trying to decipher and break the following IF/THEN/ELSE statement
 into multiple lines because I need to add some logic into it.   Being a
 PICK newbie, I'm having difficulty understanding it.  I believe this
 code was ported from an old MD Pick system but I want to make sure it
 behaves in a similar fashion once I break it apart.  I'm sure this will
 be no problem to gurus like yourselves.

IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9

 
 IF P(2)-AR(12) = 28 THEN
 CC=CC+1
 INS 0 BEFORE AR(14)1,1
 DEL AR(14)1,9
END ELSE
 IF AR(13) = DATE() THEN 
 CC=CC
 END ELSE
 INS 1 BEFORE AR(14)1,1
 DEL AR(14)1,9
 END
END
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-08 Thread Norman Morgan
How about:

IF P(2) - AR(12) = 28 THEN
CC = CC+1
INS 0 BEFORE AR(14)1,1
DEL AR(14)1,9
END ELSE
IF AR(13) = DATE() THEN
CC = CC
END ELSE
INS 1 BEFORE AR(14)1,1
DEL AR(14)1,9
END
END

===
Norman Morgan  [EMAIL PROTECTED]  http://www.brake.com
===
99% of lawyers give the rest a bad name.
===
 Checked by AVG Free Edition.
 Version: 7.1.371 / Virus Database: 267.13.12/194 - Release Date: 12/7/2005

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.12/194 - Release Date: 12/7/2005
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-08 Thread Lance Jahnke
IF P(2)-AR(12)=28 THEN  
   CC=CC+1   
   INS 0 BEFORE AR(14)1,1  
   DEL AR(14)1,9   
END ELSE 
   IF AR(13)=DATE() THEN 
  CC=CC ELSE INS 1 BEFORE AR(14)1,1
  DEL AR(14)1,9
   END   
END  


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Caleb Ng
Sent: Thursday, December 08, 2005 1:11 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Deciphering Pick UniBasic statement

I'm trying to decipher and break the following IF/THEN/ELSE statement
into multiple lines because I need to add some logic into it.   Being a
PICK newbie, I'm having difficulty understanding it.  I believe this
code was ported from an old MD Pick system but I want to make sure it
behaves in a similar fashion once I break it apart.  I'm sure this will
be no problem to gurus like yourselves.

IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9

Thanks in advance,


Caleb Ng
Systems Analyst
Sweetwater Authority
[EMAIL PROTECTED]
(619) 409-6763
---
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] Deciphering Pick UniBasic statement

2005-12-08 Thread Jerry Banker

IF P(2)-AR(12)=28 THEN
  CC=CC+1
  INS 0 BEFORE AR(14)1,1
  DEL AR(14)1,9
END ELSE
  IF AR(13)=DATE() THEN
 CC=CC
  END ELSE
 INS 1 BEFORE AR(14)1,1
 DEL AR(14)1,9
  END
END

- Original Message - 
From: Caleb Ng [EMAIL PROTECTED]

To: u2-users@listserver.u2ug.org
Sent: Thursday, December 08, 2005 1:10 PM
Subject: [U2] Deciphering Pick UniBasic statement



I'm trying to decipher and break the following IF/THEN/ELSE statement
into multiple lines because I need to add some logic into it.   Being a
PICK newbie, I'm having difficulty understanding it.  I believe this
code was ported from an old MD Pick system but I want to make sure it
behaves in a similar fashion once I break it apart.  I'm sure this will
be no problem to gurus like yourselves.

IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9

Thanks in advance,


Caleb Ng
Systems Analyst
Sweetwater Authority
[EMAIL PROTECTED]
(619) 409-6763
---
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] Deciphering Pick UniBasic statement

2005-12-08 Thread Peter Gonzalez
Several years go I wrote a utility to clean source code for Unidata, for this 
very same reason. The utility added END statements when need. It also accounted 
for all Unidata functions, Verbs. An added feature that I was not able to 
complete, due to time, was a flowchart. A second program would take the cleaned 
source and build a Visio flowchart. Maybe I'll finish it one of these days.

Pete

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Caleb Ng
Sent: Thursday, December 08, 2005 2:11 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Deciphering Pick UniBasic statement

I'm trying to decipher and break the following IF/THEN/ELSE statement
into multiple lines because I need to add some logic into it.   Being a
PICK newbie, I'm having difficulty understanding it.  I believe this
code was ported from an old MD Pick system but I want to make sure it
behaves in a similar fashion once I break it apart.  I'm sure this will
be no problem to gurus like yourselves.

IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9

Thanks in advance,


Caleb Ng
Systems Analyst
Sweetwater Authority
[EMAIL PROTECTED]
(619) 409-6763
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
R
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-08 Thread Stevenson, Charles
Everyone's going to jump in with the answer, but here's a way to figure
it out yourself (on UV, but not UD): Use VLIST.

Compile the program, then VBLIST will decompile the object (pcode) into
an assembler-kinda-looking output  you can see step by step what's
happening.

CT CDS.BP CALEB

 CALEB
0001 DIM AR(14), P(2)
0002 IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9

BASIC CDS.BP CALEB
Compiling: Source = 'CDS.BP/CALEB', Object = 'CDS.BP.O/CALEB'
Compilation Complete.

VLIST CDS.BP CALEB

1: DIM AR(14), P(2)

2: IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9
2 0 : 194 subP [2] AR [12]  = $R0 
2 8 : 0CE le $R0 28  = $R1 
2 00010 : 2DE testfw $R1 0005C: 
2 00018 : 004 addCC 1  = CC 
2 00020 : 092 fmat_load  (14, 1) AR 14 1 
2 0002C : 062 dyn_insert $MATRIX 1 1 0 0  = $MATRIX 
2 0003A : 092 fmat_load  (14, 1) AR 14 1 
2 00046 : 05E dyn_delete $MATRIX 1 9 0  = $MATRIX 
2 00052 : 10C nop
2 00054 : 0C2 jump   000AE: 
2 0005C : 04E date= $R2 
2 00060 : 06E eq AR [13] $R2  = $R3 
2 00068 : 2DE testfw $R3 0007C: 
2 00070 : 0F8 move   CC  = CC 
2 00076 : 0C2 jump   000AE: 
2 0007C : 092 fmat_load  (14, 1) AR 14 1 
2 00088 : 062 dyn_insert $MATRIX 1 1 0 1  = $MATRIX 
2 00096 : 092 fmat_load  (14, 1) AR 14 1 
2 000A2 : 05E dyn_delete $MATRIX 1 9 0  = $MATRIX 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Deciphering Pick UniBasic statement

2005-12-08 Thread Caleb Ng
The general consensus of replies confirms my findings of how this was
originally meant to be nested.  Thanks for all your help.

Caleb

 [EMAIL PROTECTED] 12/08/05 12:09PM 
IF P(2)-AR(12)=28 THEN  
   CC=CC+1   
   INS 0 BEFORE AR(14)1,1  
   DEL AR(14)1,9   
END ELSE 
   IF AR(13)=DATE() THEN 
  CC=CC ELSE INS 1 BEFORE AR(14)1,1
  DEL AR(14)1,9
   END   
END  


-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Caleb Ng
Sent: Thursday, December 08, 2005 1:11 PM
To: u2-users@listserver.u2ug.org 
Subject: [U2] Deciphering Pick UniBasic statement

I'm trying to decipher and break the following IF/THEN/ELSE statement
into multiple lines because I need to add some logic into it.   Being
a
PICK newbie, I'm having difficulty understanding it.  I believe this
code was ported from an old MD Pick system but I want to make sure it
behaves in a similar fashion once I break it apart.  I'm sure this
will
be no problem to gurus like yourselves.

IF P(2)-AR(12)=28 THEN CC=CC+1; INS 0 BEFORE AR(14)1,1; DEL
AR(14)1,9; ELSE IF AR(13)=DATE() THEN CC=CC ELSE INS 1 BEFORE
AR(14)1,1; DEL AR(14)1,9

Thanks in advance,


Caleb Ng
Systems Analyst
Sweetwater Authority
[EMAIL PROTECTED] 
(619) 409-6763
---
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/