Silverfrost Forums

Welcome to our forums

mixing /undef and /debug with inline directives

24 Aug 2017 2:02 #20049

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

24 Aug 2017 5:09 #20050

You can use an OPTIONS directive between program units. Search for 'OPTIONS directive' in the help file.

24 Aug 2017 7:37 #20051

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

25 Aug 2017 7:46 #20052

Kenny

I expect that you can.

25 Aug 2017 8:45 #20053

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

25 Aug 2017 9:24 #20054

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

Please login to reply.