Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant parens in README sample code #20

Closed
wqweto opened this issue Jun 12, 2021 · 1 comment
Closed

Redundant parens in README sample code #20

wqweto opened this issue Jun 12, 2021 · 1 comment

Comments

@wqweto
Copy link

wqweto commented Jun 12, 2021

Btw, this line in VBA

        Shell ("calc.exe")

is similar to this line in C/C++

        printf(("Hello %s"), ("World"));

with redundant parens around the string literals.

Unfortunately it's already compiled in a (redundant) Paren p-code here

        LitStr 0x0008 "calc.exe"
        Paren
        ArgsCall Shell 0x0001

Also notice that VBA IDE always puts a space between Shell and the argument so the README is faking it by manually removing the space in this line

        Shell("calc.exe")

which is obviously not a verbatim copy/paste from the VBA IDE.

@bontchev
Copy link
Owner

The parentheses are indeed redundant in this case, as far as VBA is concerned. But since they have been used in the example VBA code, they have resulted in the Paren p-code instruction being compiled, so I'm keeping both.

I have added the missing space to the README file in the develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants