Passing command line parameters to VB6 IDE in console app - vb6

I have a VB6 console app and it uses command line parameters. For debugging, I would like to be able to start it from the IDE and ideally be able to pass it those parameters to see how it normally operates. I realize I could set a breakpoint at the appropraite place and use the Immediate window to set the values outside the command line, and I have used a couple of other workarounds in the past, but is there a way to do this as if I had actually started it as a console app?

Select Project | Properties, select the Make tab, enter the command line params in the Command Line Arguments text box. These will only apply when run in the IDE.

Related

golang: optional console on windows

I am writing a service program which is expected to run in background. On Windows it will open a console window when run. I want it to go to background directly without that console window, so I used the -ldconf "-H=windowsgui" option, which worked as expected.
However, there is a catch. The program has a command line option -help, which output command line usage in the console. If I use -H=windowsgui, the help text is NOT printed even I start it in cmd.exe prompt.
It seems that the windowsgui option is not what I want. Is there anyway that the -help still works at commant line, and the console window will not persist if the program runs normally. I do not care if there is a console window pops up, provided that it disappears shortly without user intervention. i.e. I want a way on windows which is similar to the & operator on Linux.
P.S. if provided solution uses any other tools, I want that tool to be a Windows component, not any 3rd-party program. Thanks.

How to log commands that are run through command palette in Sublime Text 3

I know that commands can be logged by going to the console View -> Show Console and typing
sublime.log_commands(True)
However, the commands that are run through the command palette are not logged, it just shows:
command: show_overlay {"overlay": "command_palette"}
Is there a way to log the commands run through the palette?
There's not currently a way to log the commands that are being executed from the command palette, no. If I recall correctly, this was possible in older builds of Sublime, but around the time that the command palette gained the ability to accept input for commands like View Package File, it stopped working. That might be an offshoot of the mechanism that's used to trigger input handling in the command palette, but that's just a guess.
Normally a plugin could be used to track something like this because EventListener classes have events to tell you before and after commands execute. However, there's an open issue on the tracker regarding the command palette on triggering on_post_window_command which is likely caused by the same thing as the commands not showing up in the log.
Currently the only way to know what command and arguments are being invoked from the command palette is to introspect the sublime-commands file that's providing them.
Unlike menus, commands in the command palette are not allowed to have dynamic captions, so it's a relatively simple matter to find the command entry that has a "caption" for the text you know you're picking.
The tricky part can be in determining where the command is coming from. In the console, sublime.find_resources('*.sublime-commands') will show you a list of every known command file, and you can open them via View Package File in the command palette.
Generally, anything that ships with Sublime is in Default/Default.sublime-commands, and anything that's added by a package is prefixed by the name of the package that added it, which can aid in determining what file to check.
Note that there are some commands in the command palette that are added by Sublime and don't come from a command file; commands that insert snippets and commands that change the syntax. Those are determined on the fly since the list of syntaxes and snippets is subject to change.

How to change project->properties->Configuration Properties->Debugging->Debugging->Command Arguements using immediate or command window

How to change current command and command line set in project properties using command line?
(with Immediate Window/ Command Window).
Best I have found out is:
Project.Properties
You couldn't change it, Immediate Window often uses to display the values of variables in your code or others. For parsing c++ command-line arguments, you need to set it under the Project property.
Vote this request if other members also meet this issue:
https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/15555378-make-changing-command-line-simple

Connecting firefox "open with" with Automator script

I managed to make Firefox to follow specific protocol links (oxygen:/...) and use an application to open them. As the Mac OS X oXygen XML Developer app doesn't accept arguments, I need to use a shell script that is shipped together with oXygen itself. Given Firefox doesn't like shell scripts, I needed to write an Automator application 'Run Shell Script'. As I was having trouble to get it to work, I decided to use a stub code, with osascript, just to debug variables.
My current script looks like:
osascript -e 'display alert "'"$1"'"'
and it is defined as a bash script, receiving data as arguments.
When I click the link the dialog of osscript appears, but with an empty message. So, I am not sure how the URL is being passed to the application itself. I tried, also, with receiving data as stdin, but with no lock. I got to the point of writing a script that dumped all the parameters and STDIN to a file, but it ends up always empty.
Thank you for any hint.

How to comfortably monitor variables in a VBscript during development process? (e.g. in a continuously opened command window)

I need to write a huge VBscript to automatically run an application and I'm looking for a way to comfortably monitor what I'm actually doing, in other words, to display the values of some/all variables involved in my script.
I'm used to work with Matlab, where I have a comfortable workspace browser. When I run a Matlab script, all variables, their types and their values are accessible in that workspace and can be checked.
The VBscript I write with Notepad++ (it needs to be a free editor) and the only way I found to display variables was echoing them via wscript and cscript.
I set up the shortcuts.xml with the following line to run my script directly from Notepad++:
<Command name="Run with CScript" Ctrl="yes" Alt="no" Shift="yes" Key="116">cmd /K %windir%\system32\cscript.exe "$(FULL_CURRENT_PATH)"</Command>
In case I include commands in my script like
Wscript.Echo myVar
Wscript.Echo "Hello World!"
and run it with the newly introduced shortcut, a cmd window pops up and displays the value of myVar and "Hello World!".
But the next time I run the script a new window pops up. So my question is:
Is it possible get a continuously opened output window, displaying all echoed values everytime I run a script? I actually want to put the window on a second screen and keep the values from previous runs. So I can enter a line Wscript.Echo something, run, check, enter something else and so on, without fiddling around with a bunch of opened windows.
Alternatively, is there any open-source/free editor which offers an accessible workspace like the one in Matlab?
The open-source editor SciTE offers what I was looking for.
The default settings in vb.properties enable a similar behavior like in Notepad++
command.build.$(file.patterns.wscript)=cscript "$(FilePath)"
command.build.subsystem.$(file.patterns.wscript)=1
One can change it as follows to get the output into the integrated console.
command.go.$(file.patterns.wscript)=cscript.exe //nologo "$(FilePath)"
command.go.subsystem.$(file.patterns.wscript)=0
F5 runs the script and Shift+F5 cleans the output.
Another option is the NppExec Plugin for Notepad++ suggested by #Ansgar Wiechers, which adds a console. The script can be run with cscript.exe /nologo "$(FULL_CURRENT_PATH)" then.
Use a debugger. Start your script with the (meta)option //X. If you are lucky, you already have installed software (MS Office, Visual Studio (Express)) that provides a debugger for VBScript. If not do a bit of research to find an Express version suitable to your OS.
You can almost write native VBScript in the VBA editor, so if you have Excel or whatever you can use this to debug, then go through some steps to convert back to VBScript. That's what I usually do.

Resources