UniVerse has the compiler option "-X" (same as "-XREF") that builds a cross 
reference of all variables, includes, subroutine labels, etc.  It identifies 
the line(s) it is assigned a value, and the lines that reference it.  The key 
is the program id and is stored in a file with a .L suffix (so if you compile a 
program in the BP file, it would be stored in the BP.L file).

The "-L" ("-LIST") resolves all the includes and places it in the .L file.  The 
key is the program id.

Tom
RATEX Business Solutions

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Ed Clark
Sent: Thursday, January 26, 2012 5:40 PM
To: U2 Users List
Subject: Re: [U2] local variables

I think it's already been mentioned, but I'll repeat. Both universe and unidata 
have the ability to create a cross-reference listing of a program. unidata's is 
particularly nice and shows every variable, including what lines the variable 
is defined and used on.

but it would still be nicer to have local variables.

You can do this in mvbase. Instead of external functions defined with DEFFUN, 
mvbase has internal functions with local variables.
You can also do this in Caché.

On Jan 26, 2012, at 3:58 PM, Wjhonson wrote:

> 
> Mecki you're not paying attention.
> You have an 8000 line program that uses a variable "A"
> You didn't write it.  You need to find where that variable is assigned.
> You search for A ?
> 
> That's not going to work.
> 
> 
> 
> -----Original Message-----
> From: Mecki Foerthmann <mec...@gmx.net>
> To: u2-users <u2-users@listserver.u2ug.org>
> Sent: Thu, Jan 26, 2012 12:55 pm
> Subject: Re: [U2] Passing by Value
> 
> 
> No, you are completely wrong if you think that is only your world.
> ho in our game has the luxury working only with their own code?
> have been doing what you describe for over 25 years now and probably 
> ost of the contributors here do the same thing for a living too and 
> not ust since yesterday.
> nd I may have made that silly mistake once or twice as a junior but 
> ince then it has become second nature.
> nd in those days we didn't have the luxury of 8000 line programs 
> ecause the limit for any item was 32K and you were forced to use very 
> hort variable names and couldn't even indent your code because spaces 
> re characters too.
> n one shop I worked we used X, Y, Z etc. in 'primary' code and in 
> nternal subroutines XX, YY, ZZ and so on for loop counters.
> personally prefer more meaningful names but can't do that always 
> ecause I try to follow the naming conventions of the code I'm working on.
> Even the editor you use is irrelevant since I haven't seen one yet 
> that oesn't have a search function.
> ust go to the top of the program and search for the variable name you 
> ntend to use.
> f your search comes up negative you're safe to use it.
> imple!
> And OTOH how can you make 'rapid changes' to code if you don't 
> nderstand what it is supposed to do and where the varibles come from?
> On 26/01/2012 20:16, Wjhonson wrote:
> Completely wrong :)
> You apparently have the luxury of only working on programs written by 
> ourself.
> 
> In my world, we are called upon to make rapid changes in programs 
> written by wenty programmers over twenty years.
> You haven't specified *how* you ensure that your counters are unique, 
> and by he way, the issue is not just counters, but any variable.
> 
> 
> 
> -----Original Message-----
> From: Mecki Foerthmann<mec...@gmx.net>
> To: u2-users<u2-users@listserver.u2ug.org>
> Sent: Thu, Jan 26, 2012 12:13 pm
> Subject: Re: [U2] Passing by Value
> 
> 
> What has the length of the program to do with it?
>   always abide to the rule that a for next counter in any internal 
> ubroutine has to be unique.
> hat way even if the sub is called from within a for next loop the 
> ounters never conflict.
> o it doesn't make any difference whatsoever if a program is 80 or 8000 
> ines long.
> BTW a program with 8000 lines is usually a sign of poor design.
> On 26/01/2012 19:02, Wjhonson wrote:
>   You've never worked on programs that are 8000 lines long I take it 
> :)
> 
> 
> 
> 
>   -----Original Message-----
>   From: John Hester<jhes...@momtex.com>
>   To: U2 Users List<u2-users@listserver.u2ug.org>
>   Sent: Thu, Jan 26, 2012 10:49 am
>   Subject: Re: [U2] Passing by Value
> 
> 
>   I like to use increasing roman numerals:
>   FOR I = 1 TO COUNTER
>     GOSUB PROCESS
>   EXT I
>   PROCESS:
>   OR II = 1 TO COUNTER2
>     FOR III = 1 TO COUNTER3
>       FOR IV = 1 TO COUNTER4
> 
>       NEXT IV
>     NEXT III
>   EXT II
>   ETURN
>   -----Original Message-----
>   rom: u2-users-boun...@listserver.u2ug.org
>   mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson
>   ent: Thursday, January 26, 2012 10:09 AM
>   o: u2-users@listserver.u2ug.org
>   ubject: Re: [U2] Passing by Value
> 
>   n a related note, any clever ideas to localize a variable to a local
>   ubroutine?
>   For I = 1 to 10
>      GOSUB PROCESS
>   ext I
>   top
>   3000 Lines of code later....
>   PROCESS:
>   OR I = 1 TO 20
>   RINT I
>   EXT I
>   ETURN
>   ______________________________________________
>   2-Users mailing list
>   2-us...@listserver.u2ug.org
>   ttp://listserver.u2ug.org/mailman/listinfo/u2-users
>   ______________________________________________
>   2-Users mailing list
>   2-us...@listserver.u2ug.org
>   ttp://listserver.u2ug.org/mailman/listinfo/u2-users
> 
>   _______________________________________________
>   U2-Users mailing list
>   U2-Users@listserver.u2ug.org
>   http://listserver.u2ug.org/mailman/listinfo/u2-users
> ______________________________________________
> 2-Users mailing list
> 2-us...@listserver.u2ug.org
> ttp://listserver.u2ug.org/mailman/listinfo/u2-users
> 
> _______________________________________________
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> ______________________________________________
> 2-Users mailing list
> 2-us...@listserver.u2ug.org
> ttp://listserver.u2ug.org/mailman/listinfo/u2-users
> 
> _______________________________________________
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to