Microsoft vbscript runtime error out of string space




















Viewed 20k times. Could you paste the code around the line that return the error? The Declarations of the variables involved could be useful too — Robit. Add a comment. Active Oldest Votes. Jack Bolding Jack Bolding 3, 3 3 gold badges 39 39 silver badges 43 43 bronze badges. Otherwise great StringBuilder class : — rpetrich. This string builder is much faster and could avoid "out of string space" errors: vbaccelerator.

This error has the following causes and solutions: Expressions requiring that temporary strings be created for evaluation may cause this error. Remove any unnecessary applications from memory to create more space.

For additional information, select the item in question and press F1. Robit Robit 1 1 gold badge 2 2 silver badges 11 11 bronze badges. MarkJ Rylee Corradini Rylee Corradini 4 4 silver badges 13 13 bronze badges. Madball Madball. Contents Exit focus mode. Is this page helpful? Please rate your experience Yes No. Any additional feedback? In this article. If local variables require more local variable space than is available, try declaring some variables at the module level.

You can also declare all variables in the procedure static by preceding the Property , Sub , or Function keyword with Static. Or you can use the Static statement to declare individual static variables within procedures. Redefine some of your fixed-length strings as variable-length strings, as fixed-length strings use more stack space than variable-length strings.

You can also define the string at module level where it requires no stack space. Check the number of nested DoEvents function calls, by using the Calls dialog box to view which procedures are active on the stack. That's because MB of raw String data plus descriptors and such puts you up against the wall.

It depends on how you accomplish the "split" but using the Split function may have limitations in the way it allocates the substrings. Some alternatives use 2 passes to find the delimiters while others use a Long array to grab them and then use that data to size the final array and then extract substrings.

Using 2 passes saves you that extra array and so you have a little more wiggle room for a larger input file. I also did the reading and splitting on chunks of data instead of the entire file, which meant more Redim Preserve calls and copying but at least saved having to have 2 copies of the entire file data in RAM at once. Much larger led to Out of Memory.

Performance was quite acceptable. I apologize for just getting back to the replies on this post - the file size is , KB. Red Flag This Post Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework. Close Box. Log In Come Join Us! Posting Guidelines Promoting, selling, recruiting, coursework and thesis posting is forbidden.



0コメント

  • 1000 / 1000