View previous topic :: View next topic |
Author |
Message |
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Thu Aug 24, 2017 3:02 pm Post subject: mixing /undef and /debug with inline directives |
|
|
We have a line of code which works under /debug but flags an error under /undef or /check. we know it's not "kosher", but it is very useful!
loc(DQ) = IADD
so, is there a way to temporarily switch to /debug and then back to /undef with an embedded directive?
K |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Thu Aug 24, 2017 6:09 pm Post subject: |
|
|
You can use an OPTIONS directive between program units. Search for "OPTIONS directive" in the help file. |
|
Back to top |
|
|
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Thu Aug 24, 2017 8:37 pm Post subject: |
|
|
Thanks Paul,
i aassume we can combine that with some #ifdefs to only invoke the calls to "options (debug)" if the main compilation switch is /undef?
K |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7931 Location: Salford, UK
|
Posted: Fri Aug 25, 2017 8:46 am Post subject: |
|
|
Kenny
I expect that you can. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Fri Aug 25, 2017 9:45 am Post subject: |
|
|
So come on, Kenny - what's so 'very useful' about it? Educate us (well, me). I didn't know you could put a function on the LHS of an assignment.
(I've liked the word 'kosher' in this context since seeing it transcribed by an Irish secretary from dictation as 'cauchre' - which puzzled everyone until the witness statement was read aloud!)
Eddie |
|
Back to top |
|
|
KennyT
Joined: 02 Aug 2005 Posts: 317
|
Posted: Fri Aug 25, 2017 10:24 am Post subject: |
|
|
aah - i could tell you but then i'd have to shoot you!
In our application we have structures, variables and their addresses. For historical reasons (the GUI code predates the use of pointers and structures), we don't want to pass the POINTER to the structure, but we want to set its address so that we can pass it to the GUI subroutines.
loc(DQ) = IADD
does just that!
i think it only works with LOC and is probably of no use to anyone writing code from scratch, but very useful for us as it saved re-writing huge chunks of code!
K |
|
Back to top |
|
|
|