![]() | |
#11
| |||
| |||
|
#12
| |||
| |||
|
|
How can the compiler know what's valid to pass and what's not? The only problem with passing a parameter that's also common is garbage collect tries to give up the space used by the subroutine, so when it gives up the passed parameter, it also throws away your common variable and puts a hole in the descriptor table. But the compiler is totally issolated from data issues and could care less. For example, the following compiles just fine in flash or standard basic, and barfs big time (if I tried to run it): common a,b,c call testit(a,b,c) stop Mark "Dale" <dale_benedict (AT) flightcraft (DOT) ca> wrote in message news:1171571918.436619.103240 (AT) k78g2000cwa (DOT) googlegroups.com... I've beat my head against many wall dealing with these flash-compile errors, and 90% of the time it has to do with parameter passing. Regards, Dale |
#13
| |||
| |||
|
|
Mark, The compile error that Jeff is getting is caused by the first two lines of the subroutine. eg. 001 subroutine mysub( a, b, c 002 d,e,f) The regular p-code compile handles this find, but the flash-compile chokes. I haven't tried to first compile to p-code using the 'C' option to suppress the eol markers and the flash-compile the object only. I suspect this may work, but like most others I prefer to be able to drop into debug and look at where the program is if there is an error. By the way, this problem has been reported to RD. Regards, Dale On Feb 15, 11:23 pm, "Mark Brown" <mbr... (AT) drexelmgt (DOT) com> wrote: How can the compiler know what's valid to pass and what's not? The only problem with passing a parameter that's also common is garbage collect tries to give up the space used by the subroutine, so when it gives up the passed parameter, it also throws away your common variable and puts a hole in the descriptor table. But the compiler is totally issolated from data issues and could care less. For example, the following compiles just fine in flash or standard basic, and barfs big time (if I tried to run it): common a,b,c call testit(a,b,c) stop Mark "Dale" <dale_bened... (AT) flightcraft (DOT) ca> wrote in message news:1171571918.436619.103240 (AT) k78g2000cwa (DOT) googlegroups.com... I've beat my head against many wall dealing with these flash-compile errors, and 90% of the time it has to do with parameter passing. Regards, Dale- Hide quoted text - - Show quoted text - |
#14
| |||
| |||
|
|
Not on D3 it doesn't. mbp 'testx' size = 65 filed Flash (Y/N/X/C/O/Z): ?c testx 0001 subroutine abc(a,b,c [B102] Line 1: Bad statement. . 0002 d,e) [B102] Line 2: Bad statement. [B100]*Line 7: Compilation aborted; no object code produced. Mark "Dale" <dale_benedict (AT) flightcraft (DOT) ca> wrote in message news:1171642295.943696.277920 (AT) a75g2000cwd (DOT) googlegroups.com... Mark, The compile error that Jeff is getting is caused by the first two lines of the subroutine. eg. 001 subroutine mysub( a, b, c 002 d,e,f) The regular p-code compile handles this find, but the flash-compile chokes. I haven't tried to first compile to p-code using the 'C' option to suppress the eol markers and the flash-compile the object only. I suspect this may work, but like most others I prefer to be able to drop into debug and look at where the program is if there is an error. By the way, this problem has been reported to RD. Regards, Dale On Feb 15, 11:23 pm, "Mark Brown" <mbr... (AT) drexelmgt (DOT) com> wrote: How can the compiler know what's valid to pass and what's not? The only problem with passing a parameter that's also common is garbage collect tries to give up the space used by the subroutine, so when it gives up the passed parameter, it also throws away your common variable and puts a hole in the descriptor table. But the compiler is totally issolated from data issues and could care less. For example, the following compiles just fine in flash or standard basic, and barfs big time (if I tried to run it): common a,b,c call testit(a,b,c) stop Mark "Dale" <dale_bened... (AT) flightcraft (DOT) ca> wrote in message news:1171571918.436619.103240 (AT) k78g2000cwa (DOT) googlegroups.com... I've beat my head against many wall dealing with these flash-compile errors, and 90% of the time it has to do with parameter passing. Regards, Dale- Hide quoted text - - Show quoted text - |
#15
| |||
| |||
|
|
The fact that this code 0001 * test 0002 call sub(a,b,c 0003 ,d,e,f) will not compile with the flash option is not a bug, imo. The fact that it does compile in regular, non-flash mode is the bug. I don't know of any other basic funtions or commands that will compile when spread over multiple lines. How about: open "file" to fv else stop 201 or x = oconv( date(),"d2-") BTW, here is what happens when I try to flash-compile the call sub example: (d3/linux 7.4.2.A202) :compile bp sb (o sb 0002 call sub(a,b,c [B102] Line 2: Bad statement. 0003 ,d,e,f) [B102] Line 3: Bad statement. B102 3 [B100]*Line 0: Compilation aborted; no object code produced. So on this system, at least, the compile seems to give a pretty clear indication of where the problems are. As mentioned previously, there are some variants of this that will (unfortunately) flash-compile: 0001 * test 0002 call sub(a,b,c, 0003 d,e,f) however, just because it compiles does not mean it will run: :run bp sb [876] FlashBASIC object of program 'sb' was created on a different machine - please recompile. This, I think, is a legitimate bug. /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 |
#16
| |||
| |||
|
|
As usual, I agree with Scott's evaluation that this is a bug. But this is one of those areas where the bug may be able to invoke a grandfather clause such that it should not be fixed. It depends on when the "feature" crept in that allows a CALL to break across lines. I think the real solution to this and many similar issues is a series of OPTION flags like we see in other platforms, where if you want or don't want a certain behaviour that was valid in some prior release, you need to set or unset a flag for it. This can be set in a logon macro, individual code, or maybe in an item in the program file. |
|
Regarding which statements do or do not break across lines, I could have sworn I read somewhere a couple years ago that line breaks are allowed for COMMON, and possibly for CRT/PRINT (certainly not CALL). That could be platform specific and not even apply to D3, dunno. T "Scott Ballinger" wrote: The fact that this code 0001 * test 0002 call sub(a,b,c 0003 ,d,e,f) will not compile with the flash option is not a bug, imo. The fact that it does compile in regular, non-flash mode is the bug. I don't know of any other basic funtions or commands that will compile when spread over multiple lines. How about: open "file" to fv else stop 201 or x = oconv( date(),"d2-") BTW, here is what happens when I try to flash-compile the call sub example: (d3/linux 7.4.2.A202) :compile bp sb (o sb 0002 call sub(a,b,c [B102] Line 2: Bad statement. 0003 ,d,e,f) [B102] Line 3: Bad statement. B102 3 [B100]*Line 0: Compilation aborted; no object code produced. So on this system, at least, the compile seems to give a pretty clear indication of where the problems are. As mentioned previously, there are some variants of this that will (unfortunately) flash-compile: 0001 * test 0002 call sub(a,b,c, 0003 d,e,f) however, just because it compiles does not mean it will run: :run bp sb [876] FlashBASIC object of program 'sb' was created on a different machine - please recompile. This, I think, is a legitimate bug. /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 |
![]() |
| Thread Tools | |
| Display Modes | |
| |