Is there a way to call both FlashBASIC subroutines (compiled using the "(o" option) as well as standard subroutines from a single BASIC programme?
I can of course mirror the non-Flash ones, but that's a bit untidy. I can't just Flash the non-Flash ones, as they are used all over the place by other BASIC programmes.
I need to use the Flash option for a socket sender subroutine.
No idea about D3 Windows, but D3 Linux:
:CT UTILS B11 B12
B11
001 CALL B12
B12
001 SUBROUTINE B12
002 PRINT 'HELLO'
003 RETURN
004 END
:BASIC UTILS B11
B11
.
[241] Successful compile! 1 frame(s) used.
:BASIC UTILS B12 (O
B12
.
[820] Creating FlashBASIC Object ( Level 0 ) ...
[241] Successful compile! 2 frame(s) used.
:RUN UTILS B11
HELLO
So it looks like a non-flash compiled main program will call a flash compiled subroutine just fine. Not sure why you need to compile socket routines with flash. Are you using something like:
sock = %socket(AF$INET, SOCK$STREAM, 0)
This works fine non-flash compiled on D3 Linux.
Is there a way to call both FlashBASIC subroutines (compiled using the "(o" option) as well as standard subroutines from a single BASIC programme?
I can of course mirror the non-Flash ones, but that's a bit untidy. I can't just Flash the non-Flash ones, as they are used all over the place by other BASIC programmes.
I need to use the Flash option for a socket sender subroutine.
When you flash compile a subroutine ( O option ), the flash object is available but not necessarily used by the calling program. If the main program is not flashed, the subroutine's non-flash object will be called. If the main program IS flash compiled, the subroutine's flash object is called. Once you're running in flash, every subroutine called thereafter must be flashed. There is a way to run a flash-compiled main program in non-flash mode, but I forget what it is. So I've found that the best practice is to flash all subroutines and let the main program determine the run mode.
As far as Bryan's comment about socket stuff, he's correct that they do not need to be flash compiled in D3 Linux. However, anything using %functions in D3 Windows must be flash compiled.
Is there a way to call both FlashBASIC subroutines (compiled using the "(o" option) as well as standard subroutines from a single BASIC programme?
I can of course mirror the non-Flash ones, but that's a bit untidy. I can't just Flash the non-Flash ones, as they are used all over the place by other BASIC programmes.
I need to use the Flash option for a socket sender subroutine.
Thank you, both Brian and Bryan.
In the end I removed the FlashBASIC compile from the main programme. I then changed that main programme to trigger the socket sender programme (which is Flash-compiled) by way of executing a proc (rather than a call), then did just a normal compile on the main programme. This works perfectly, and doesn't disturb any existing processes.
Thanks again for helping me work towards a good and tidy solution.