RE> What I?m not sure how to do (well, I?m unwilling to spend the time,
because WTH) is capture spaces within a variable name.
If anyone puts spaces in a variable name, well, they deserve what they
get.
I also realized that constructions such as ARRAY
TEXT($aMyTextArray;$ArraySize) contain
Hi,
I have this regex to find all kind of variable in QS_Toolbox. May it will
help you to increase the impact of your method ;-)
$PatternVariables:="(?mi-s)(\\b[[:alpha:]][\\w+]*\\b)[?=\\:|\\;|\\)|\\>|\\<|\\{|\\}|\\]|\\[|\\r|\\n]|(\\$[\\w+]*\\b)|(<>[[:alpha:]][\\w+]*\\b)"
Patrick
-
Bob
I have a component that declares all my variables(not just locals). Locals were
simple-everything else was hard. It relies on you having a definable format(i.e
type is at end or demarked by _ ) and having consistent(even if varying) way of
identifying type (e.g _at is is array text and
> On Apr 27, 2018, at 12:17 PM, Bob Miller via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
>
> RE> I don?t have a macro for you, but I?m curious to know why asking the
> compiler to check the syntax isn?t enough?
Another reason is that for some usages of a local variable starting with one of
the
I was looking at that string and testing it a bit more (after it’s been
canonized, of course.)
Underscores aren't captured in the original, which a lot of us use - e.g.e,
$somestring_t
This captures those: \$[_a-zA-Z0-9]* All I did was add the underscore
between the [].
What I’m not sure
Wow! Useful, thanks.
Sent from my iPhone
>
**
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:
Thanks to everyone for all the responses!
I put the macro at the end of this posting.
Cannon Smith inquired:
RE> I don?t have a macro for you, but I?m curious to know why asking the
compiler to check the syntax isn?t enough?
1. It may not be a syntactical problem; I may have simply forgotten
On Apr 27, 2018, at 1:03 PM, Jody Bevan wrote:
> I would suggest if you are going to write something this far, why not make it
> so that it will declare all local variables for you, and remove declarations
> that are no longer needed. A great time saver. Of course to go that far,
> there needs
$localRegex:="\\$[0-9_\\p{Letter}]+" //Includes parameters. Assumes locals do
not have spaces.
A simple way to ensure you are not matching within strings is to split the
method into lines and then on each line collapse the strings so they are empty.
You only need to do this on lines that have
Hi,
I haven't a macro but a tool that try to answer to this point (not only).
It works on local ($), variable (without $ or <>) and global (<>) variable.
Manage $ and <> variables is pretty easy, standard variable, more difficult.
So, this code works with method of all objects and cross
Bob:
Another thought to watch out for.
As you know in some cases 4D names some of it’s own things starting with a ‘$’.
For example a Process name can be named starting with a ‘$’. If you have
strictly named local variables those should be easy to filter out.
Jody
> On Apr 27, 2018, at 9:54
Bob:
I would suggest if you are going to write something this far, why not make it
so that it will declare all local variables for you, and remove declarations
that are no longer needed. A great time saver. Of course to go that far, there
needs to be a strictly enforced naming convention.
On Apr 27, 2018, at 8:54 AM, Bob Miller via 4D_Tech <4d_tech@lists.4d.com>
wrote:
>
> Hello,
>
> Has anyone created a macro to check a method to make sure all its local
> variables are declared?
>
> I've thought about undertaking such a thing, but as it probably involves
> getting into
Hello,
Has anyone created a macro to check a method to make sure all its local
variables are declared?
I've thought about undertaking such a thing, but as it probably involves
getting into regular expressions, I've been looking forward to doing this
with some dread.
If anyone has done this
14 matches
Mail list logo