numberformat woes?

Klaus major-k klaus at major-k.de
Thu Nov 7 08:19:02 EST 2019


Bonjour Thierry,

> Am 07.11.2019 um 14:09 schrieb Thierry Douez via use-livecode <use-livecode at lists.runrev.com>:
> 
> Hallo Klaus,
> 
> Umm, thinking loudly, I would say numberformat has a local scope ...

ah, that was what I was missing, merci, mon ami!

But see below...

function fNextNr
 set the numberformat to 0000
 put the cLetzteLaufendeNummer of this stack into tNextNr
 if tNextNr = EMPTY then
     put 1 + 0 into tNewNext
 else
     put tNextNr + 1 into tNewNext
 end if
 ## !!
 ## However this line IS Inside of the local cope of numberformat
 set the cLetzteLaufendeNummer of this stack to tNewNext
 ## !!
 return tNewNext
end fNextNr

So -> the cLetzteLaufendeNummer of this stack should result in e.g. 0003 but is in fact 3?
At least this is shown in the Custom Property departement of the inspector for my stack.

Hm, it is getting even stranger, maybe I just don't get it? :-D
This:
...
put the cLetzteLaufendeNummer of this stack
...
-> 3

But this:
...
set the numberformat to 0000
put the cLetzteLaufendeNummer of this stack
...
-> 0003

No arithmetic operation involved!?

> Regards,
> 
> Thierry

Best

Klaus

--
Klaus Major
https://www.major-k.de
klaus at major-k.de





More information about the use-livecode mailing list