Debugger - Unable to view Variables > 47 character

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
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.
This topic is 17 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
remark
Posts: 3
Last visit: Mon Jan 08, 2007 6:04 am

Debugger - Unable to view Variables > 47 character

Post by remark »

We are currently evaluating PrimalScript Professional as a .VBS debugging tool. Upon running any script where a variable is 48 characters or greater, the debugger comes back displaying "variable (String) = ..." Most of our scripts will have large variable strings/arrays, is there any way this information can be expanded out to be seen?
User avatar
Alexander Riedel
Posts: 8489
Last visit: Thu Apr 18, 2024 9:59 am
Answers: 20
Been upvoted: 37 times

Debugger - Unable to view Variables > 47 character

Post by Alexander Riedel »

The magic number is 50. You can add the variable to the watch window on the
right side, which should not have any length limitation.

I'll check if we can expand the max length to something more practical in the next service build.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
remark
Posts: 3
Last visit: Mon Jan 08, 2007 6:04 am

Debugger - Unable to view Variables > 47 character

Post by remark »

Thanks for the quick feedback...
The most digits that can fit in the normal variable window is the following (47 / 49 with quotes)

var1 = "123456789A123456789B123456789C123456789D1234567"

I figured out how to get the watch window to work and the most it will show is the following (258 / 260 with quotes):

var2 = "123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789S123456789T123456789U123456789V123456789W123456789X123456789Y12345678"

We use variables to hold several long text files and data so we're not sure the 258 character max will work for us.

User avatar
donj
Posts: 416
Last visit: Thu May 29, 2008 5:08 am

Debugger - Unable to view Variables > 47 character

Post by donj »

Let me offer a suggestion unrelated to PrimalScript itself. Drop the code (at the end of this post) into your script. When you're at a point in your script where you need to be able to review the contents of one of those long variables, call Debug(var). It'll appear in a seperate IE pop-up window - so it won't co-mingle with your script's output. Uncomment the "Exit Sub" (in my code, below) when you no longer need this functionality.

I'm not sure I could think of a way for a debugger UI to make the contents of an entire text file, held within a variable, easy to review. I mean, it's just a lot, a lot, a lot of data for that type of user interface. However, by having the variable contents come up in an external window (which is what my sub does), you can review it much more readily.

I do more or less the same thing not only in scripts but also in Microsoft Visual Studio, which uses a very similar debugger UI. I typically use this same solution I'm suggesting, just because it's more effective even than using the Immediate window in Visual Studio - I can review the big variables much more readily.

Just a suggestion for you.

Dim oIESub Debug(strText)
'HOW TO USE: ' --> Debug("This is the text") ' This will display "this is the text" in a debug window
'uncomment the next line to turn off debugging 'Exit Sub If Not IsObject(oIE) Then Set oIE = CreateObject("InternetExplorer.Application") oIE.Navigate "about:blank" oIE.Visible = True oIE.ToolBar = False oIE.Width = 200 oIE.Height = 300 oIE.Left = 10 oIE.Top = 10 Do While oIE.Busy WScript.Sleep 100 Loop oIE.Document.Body.InnerHTML = "<b>" & Now & "</b><br>" End If oIE.Document.Body.InnerHTML = _ oIE.Document.Body.InnerHTML & strText & "<br>" & VbCrLfEnd Sub
This topic is 17 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.