![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Eek. I'd like to know how the compiler knows what's what between calls. XYZ is one array. X1, Y(1), and Z(1) are three different variables. I'd have to agree with UV for getting confused on how to link the commons in the three programs. If D3 and mvE does it, then I guess the compiler will create individual common space for each program, based on total variable count. Can you really access XYZ(1) in TEST2 and get valid data from TEST1? Glen "Jonathan Rogers" <thatseattleguy (AT) gmail (DOT) com> wrote in message news:1141238598.422731.4710 (AT) t39g2000cwt (DOT) googlegroups.com... The following all works in D3 and mvEnterprise, AFAIK: TEST1 0001 COMMON XYZ(25) 0002 CALL TEST2 0003 ENTER TEST3 TEST2 0001 SUBROUTINE TEST2 0002 COMMON X(10) 0003 COMMON Y1,Y2,Y3,Y4,Y5 0004 COMMON Z(10) 0005 RETURN TEST3 0001 COMMON XX(20) 0002 COMMON YY(5) 0003 PRINT "GOT TO TEST3" In other words, I can define a single big array that overlays the entire common space of another program or programs, subroutine or mainline, even if some of the variables don't match in type or array dimensions - all that's important is the total number of them in common being equal (in this case, all have 25 total variables). The problem is that in Universe, this doesn't fly. Neither TEST2 or TEST3 is callable from TEST1; I get "COMMON size mismatch in TEST2" (or TEST3). Ignoring (please!) for the moment *why* someone would want or need to do this, is there any way to make a "common overlay" fly in UV? =jon= |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Eek. I'd like to know how the compiler knows what's what between calls. XYZ is one array. X1, Y(1), and Z(1) are three different variables. I'd have to agree with UV for getting confused on how to link the commons in the three programs. If D3 and mvE does it, then I guess the compiler will create individual common space for each program, based on total variable count. Can you really access XYZ(1) in TEST2 and get valid data from TEST1? Glen "Jonathan Rogers" <thatseattleguy (AT) gmail (DOT) com> wrote in message news:1141238598.422731.4710 (AT) t39g2000cwt (DOT) googlegroups.com... The following all works in D3 and mvEnterprise, AFAIK: TEST1 0001 COMMON XYZ(25) 0002 CALL TEST2 0003 ENTER TEST3 TEST2 0001 SUBROUTINE TEST2 0002 COMMON X(10) 0003 COMMON Y1,Y2,Y3,Y4,Y5 0004 COMMON Z(10) 0005 RETURN TEST3 0001 COMMON XX(20) 0002 COMMON YY(5) 0003 PRINT "GOT TO TEST3" In other words, I can define a single big array that overlays the entire common space of another program or programs, subroutine or mainline, even if some of the variables don't match in type or array dimensions - all that's important is the total number of them in common being equal (in this case, all have 25 total variables). The problem is that in Universe, this doesn't fly. Neither TEST2 or TEST3 is callable from TEST1; I get "COMMON size mismatch in TEST2" (or TEST3). Ignoring (please!) for the moment *why* someone would want or need to do this, is there any way to make a "common overlay" fly in UV? =jon= |
#5
| |||
| |||
|
|
Eek. I'd like to know how the compiler knows what's what between calls. XYZ is one array. X1, Y(1), and Z(1) are three different variables. I'd have to agree with UV for getting confused on how to link the commons in the three programs. If D3 and mvE does it, then I guess the compiler will create individual common space for each program, based on total variable count. Can you really access XYZ(1) in TEST2 and get valid data from TEST1? Glen "Jonathan Rogers" <thatseattleguy (AT) gmail (DOT) com> wrote in message news:1141238598.422731.4710 (AT) t39g2000cwt (DOT) googlegroups.com... The following all works in D3 and mvEnterprise, AFAIK: TEST1 0001 COMMON XYZ(25) 0002 CALL TEST2 0003 ENTER TEST3 TEST2 0001 SUBROUTINE TEST2 0002 COMMON X(10) 0003 COMMON Y1,Y2,Y3,Y4,Y5 0004 COMMON Z(10) 0005 RETURN TEST3 0001 COMMON XX(20) 0002 COMMON YY(5) 0003 PRINT "GOT TO TEST3" In other words, I can define a single big array that overlays the entire common space of another program or programs, subroutine or mainline, even if some of the variables don't match in type or array dimensions - all that's important is the total number of them in common being equal (in this case, all have 25 total variables). The problem is that in Universe, this doesn't fly. Neither TEST2 or TEST3 is callable from TEST1; I get "COMMON size mismatch in TEST2" (or TEST3). Ignoring (please!) for the moment *why* someone would want or need to do this, is there any way to make a "common overlay" fly in UV? =jon= |
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
|
This works because after the compile, there are no field names, just descriptor table entries. So if you define 25 "common" fields in test1, that just means the first 25 entries in the table are "common". When test2 loads, it knows there are 25 common elements, it just calls them by different names, but the compiler recognizes that the first common field is the first common field, regardless. I used to do this all the time. It's quite handy to call an INIT subroutine that just does ALFIELDS='' and returns. |
#9
| |||
| |||
|
|
Mark Brown wrote: This works because after the compile, there are no field names, just descriptor table entries. So if you define 25 "common" fields in test1, that just means the first 25 entries in the table are "common". When test2 loads, it knows there are 25 common elements, it just calls them by different names, but the compiler recognizes that the first common field is the first common field, regardless. I used to do this all the time. It's quite handy to call an INIT subroutine that just does ALFIELDS='' and returns. MAT ALFIELDS='' perhaps? -- frosty |
![]() |
| Thread Tools | |
| Display Modes | |
| |