Hi all,
Two questions:
1. Is there a way to format real numbers to 4 decimal places? I found %[charLength]d but that only rounds to whole numbers. I'm interested in the decimals, just truncated or rounded to 4 places beyond the decimal point.
2. I love Rev's ability to permit local variable to be used willy nilly. However, is there a quick and dirty way to assess whether all global variable have been identified as such in the necessary handles? I've had several rather long debug sessions due to my
A. forgetting to declare global variable in both handles
B. switching a variable name at some point making it become a local variable that was never meant to be one (global: testType accidentally becoming trialType)
C. finding the appropriate handle to "compile" in
During compile, Delphi would tell me where all undeclared variables were. Even sweeter, Delphi would tell me what variable went unused and could be deleted from the declarations.
Lastly, is there a way to compile all handles at once rather than my having to compile within each handle?
Thanks all,
Josh
Formatting decimals, global/local variables, and compiling
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Dear Josh,
1) Two examples, returning "9.00":
or
2) There is no way for Rev to know that an undeclared local variable was actually meant to be global. You might set the explicitVariables to true, but this will make it necessary to declare all local variables as well. Thus the answer is no.
Best,
Mark
1) Two examples, returning "9.00":
Code: Select all
set the numberformat to "0.00"
put 9*1 -- any calculation will do
Code: Select all
put format("%.2f",9)
2) There is no way for Rev to know that an undeclared local variable was actually meant to be global. You might set the explicitVariables to true, but this will make it necessary to declare all local variables as well. Thus the answer is no.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode