Debugging VBS scripts

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
johnlo
Posts: 9
Joined: Wed Oct 20, 2010 1:29 pm

Debugging VBS scripts

Post by johnlo » Thu Jan 24, 2019 1:00 am

PrimalScript 2019, Version 7.4.124.0,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?

User avatar
johnlo
Posts: 9
Joined: Wed Oct 20, 2010 1:29 pm

Re: Debugging VBS scripts

Post by johnlo » Thu Jan 24, 2019 1:35 am

Please pardon the rushed and poor English!

User avatar
Alexander Riedel
Posts: 7053
Joined: Tue May 29, 2007 4:43 pm

Re: Debugging VBS scripts

Post by Alexander Riedel » Thu Jan 24, 2019 1:49 am

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.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
johnlo
Posts: 9
Joined: Wed Oct 20, 2010 1:29 pm

Re: Debugging VBS scripts

Post by johnlo » Thu Jan 24, 2019 10:13 pm

My PrimalScript version is "PrimalScript 2019, Version 7.4.124.0, 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.?

User avatar
Alexander Riedel
Posts: 7053
Joined: Tue May 29, 2007 4:43 pm

Re: Debugging VBS scripts

Post by Alexander Riedel » Fri Jan 25, 2019 12:22 am

No files attached here. Please attach or upload them here (zipped): https://www.sapien.com/auth/other/support/upload

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.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
johnlo
Posts: 9
Joined: Wed Oct 20, 2010 1:29 pm

Re: Debugging VBS scripts

Post by johnlo » Fri Jan 25, 2019 12:42 am

Both Scripts attached (I hope) in one zip file.
Attachments
DeleteUnifaceTempFolderUsingSUB.zip
(1.03 KiB) Downloaded 36 times

User avatar
Alexander Riedel
Posts: 7053
Joined: Tue May 29, 2007 4:43 pm

Re: Debugging VBS scripts

Post by Alexander Riedel » Fri Jan 25, 2019 5:47 am

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.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
johnlo
Posts: 9
Joined: Wed Oct 20, 2010 1:29 pm

Re: Debugging VBS scripts

Post by johnlo » Fri Jan 25, 2019 3:34 pm

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.