Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Re-factoring for "add extern"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sitnduck
Senior Member

47 Posts

Posted - Jul 22 2024 :  08:30:59 AM  Show Profile  Reply with Quote
When I create a global variable in a CPP file, it would be nice to be able to generate an "extern" in the header file, e.g.:

CPP
int g_iMyGlobal = 0;

H
extern int g_iMyGlobal;

Apologies if this exists and I missed it!

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jul 23 2024 :  08:34:25 AM  Show Profile  Reply with Quote
I don't know of any command for this, so I don't think you have missed one

How would VA know you are planning on making this an extern? Or just offer the option on any file scope variable in a cpp file? Since being a file scope, so "global" variable doesn't mean its an extern variable, not something we would want to try to do automatically.

zen is the art of being at one with the two'ness
Go to Top of Page

sitnduck
Senior Member

47 Posts

Posted - Aug 14 2024 :  07:53:09 AM  Show Profile  Reply with Quote
Yes, something like that, it's very similar to "Quick actions and re-factoring->Create Declaration". It would be an added "->Create Extern Declaration", and generates that line in the header.

Thank you!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Aug 14 2024 :  11:00:07 AM  Show Profile  Reply with Quote
That makes sense, and I just wanted to make sure that I understood what you were thinking properly here I have put in a feature request for this:

case=164869

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000