I have been trying to figure out why I cannot return a Long Long
value from a routine.

I have two routines.  One converts a string to Long Long value
and returns the LL to the calling program. The other routine converts a
LL to a string for display.

I have verified the LLToString works for all values of LL passed
to the function.  String displays properly.

I have verified that the StringToLL calcualtes the correct value
right up to the point just prior to the return LLVal;

The problem is that the calling instruction is evaluated as
zero: x = StrToLL(char *str).  

Now to isolate the problem, I figured I could use a Global 
variable since I could not return the LL value but I discovered
something odd.  So, I decided to bypass the StrToLL just to work
on a solution to this problem and to further isolate the problem.

This works:
unsigned long long x;
x = 9223372036854775806UL   // x is local to calling statement
StrLLToS(unsigned long long x);  // displays correctly

This does not work:
x = 92233720369854775806UL  // x is global and unsigned long long
StrLLToS(unsigned long long x);  // displays as zero

There is some problem with LL's when accessed as Global variables.

I think the explanation to why this difference is the same
reason that I cannot return the LL value in my StrAToLL function.

Can anyone shed light on this problem?  What is the solution?
I cannot return LL values from a function.
I cannot access LL values properly, if global.

----------------------------------------------------
Shoot-to-Win

Protect the 2nd Amendment
----------------------------------------------------

Reply via email to