Thanks Ben,

your answer tipped me off to an easy solution.
I'm just wrapping relevant sections in

#pragma warn_a5_access on

no-global code here

#pragma warn_a5_access reset

which (if I understand correctly) should warn me whenever there is a  
problem.
I was surprised to find that

Char    timeString[timeStringLength]="";

was being treated as a global...

thanks again,

Rob

On Thu, 25 Oct 2007 01:13:19 +0100, Ben Combee <[EMAIL PROTECTED]>  
wrote:

>
> On 10/24/07, Rob <[EMAIL PROTECTED]> wrote:
>> In a previous thread, Ben described things that you can't access when  
>> your
>> app is running as a sublaunch without globals
>>
>> "You cannot access any variables that aren't located on the stack.  This
>> includes global variables, static variables, and some kinds of constant
>> data."
>>
>> My question is - 'what kinds of constant data?'
>>
>> I know I can't use normal globals
>> I know I can't use static variables
>>
>> but what about initialisers
>>
>> RectangleType           bottomRect={0,145,160,15};
>> or
>> Char                    string[]={"initialise with string"};
>> or
>> StrCopy(stringP,"some text to copy");
>>
>> what is the underlying rule here - how do I know what Codewarrior will  
>> put
>> on the stack vs what it won't ???
>
> Actually, the question is "what will CodeWarrior put in PC-relative
> storage (code segment) and what will CW put in global storage (data
> segment that gets copied to the heap at app startup).
>
> Anonymous constant data that doesn't contain pointers will probably be
> PC-allocated.  The key is to use the "Disassemble" command and look at
> the function.  If you see code that uses A5, you've got global access.
>  If you're code uses PC, then you're OK.
>


-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to