Page 1 of 1

Debugging VBS scripts

Posted: Thu Jan 24, 2019 1:00 am
by johnlo
PrimalScript 2019, Version,build ??? (don't know where to find this)|
32 or 64 bit version of product: Again, how do I find this out? It's a 64bit OS but can't see where to find out where to get this info!
Operating system:
32 or 64 bit OS: 64 bit!

How to enable Debugging on VBS Scripts!
Hi I have many "vbscript" scripts and soem whe I open in "primalscript (2019)" alow me to watch variables as I debug them and yet others do not...

Can anyone help me?

Re: Debugging VBS scripts

Posted: Thu Jan 24, 2019 1:35 am
by johnlo
Please pardon the rushed and poor English!

Re: Debugging VBS scripts

Posted: Thu Jan 24, 2019 1:49 am
by Alexander Riedel
The build is 124. Our version numbers are organized as Major.Minor.Build
If you do not remember if you installed the 32 or 64 bit version, you can determine that by either the installation folder ("Program Files" for 64 bit, "Program Files (x86)" for 32 bit) or by looking at the PrimalScript process in the task manager, it would clearly state (32 Bit) if it is not a 64 bit process.

From your post it is not clear if you are not able to debug these 'other' scripts or if you cannot see any variables while debugging.
In the earlier email exchange it sounded more like you cannot debug some scripts at all whereas this post sounds more like you do not see any variable in the Variables pane (presumably).
It would maybe be helpful to attach a problem script here or post a screenshot, pointing out where the actual problem lies.

Re: Debugging VBS scripts

Posted: Thu Jan 24, 2019 10:13 pm
by johnlo
My PrimalScript version is "PrimalScript 2019, Version, 64Bit" and the OS is Windows 10 Professional (x64bit) Version 1803.
I have two scripts one has no Functions or Procedures and this debugs as you would expect. If click 'Go' to debug the scripts it stops where you put breakpoints and at each breakpoint the execution stops and you use the Call Stack, Watch, Variables and Debug tabs.

The other script uses Functions and Procedures and upon clicking the 'Go' button doesn't appear to actually stop at the breakpoint (located in a similar location to the first script - a variable declaration) and in fact the Icon at the breakpoint doesn't change as it does it the first.

I have attached both scripts and it's the one titled "DeleteUnifaceTempFolderUsingSUB.vbs" that is giving me grief.

Any assiatnce would be greatly appreciated

Also, can you point me in the direction of a keyboard map e.g. Shortcut keys for deleting lines with the editor etc.?

Re: Debugging VBS scripts

Posted: Fri Jan 25, 2019 12:22 am
by Alexander Riedel
No files attached here. Please attach or upload them here (zipped):

The product manual has a page with all keyboard shortcuts. (Help tab -> PrimalScript manual)

Delete Line Ctrl+Shift+L

Additionally, the little down arrow next to the about icon on the ribbon opens a dynamic keyboard dialog, which shows all shortcut keys associated with functions available on the ribbon. You can go to File -> Customize keyboard to re-assign some keyboard shortcuts if you so desire.
Please note that your custom shortcuts may be removed if an update contains a modified default layout.

Re: Debugging VBS scripts

Posted: Fri Jan 25, 2019 12:42 am
by johnlo
Both Scripts attached (I hope) in one zip file.

Re: Debugging VBS scripts

Posted: Fri Jan 25, 2019 5:47 am
by Alexander Riedel
The file "DeleteUnifaceTempFolderUsingSUB.vbs" (as uploaded) will not stop in the debugger or at any breakpoint because the script does effectively nothing.
It defines a function and a sub. Both of them are never called from a global context. Therefore the script basically exits after nothing has been executed.

Re: Debugging VBS scripts

Posted: Fri Jan 25, 2019 3:34 pm
by johnlo
Removing the Function allowed the script to work as expected.

Thanks for the prompt reply and resolution, clearly it's been a long.... time away from scripting for me.