String length issue

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

String length issue

Postby Delco » Mon Feb 03, 2025 9:06 am

Is there a limit how long a string from the gcode can be read , I have programs names nested 3 levels deep and some of the names are wordy , So I assume a long string .
I use a string obtained from the gcode to display a image on the screen , but if it goes over a certain number of characters it comes up with a error.

string m130 = exec.Getcurrgcodelinetext();
string output = m130.Split('(', ')')[1];
string Path = @"D:\g kod\forum\has\"+ output; // put your path folder for images between quotations
Delco
 
Posts: 388
Joined: Tue Apr 02, 2019 4:23 am

Re: String length issue

Postby cncdrive » Mon Feb 03, 2025 5:30 pm

We do not limit the string length in the UCCNC, the max. length of strings is defined by the .net compiler, I'm not sure about the exact length, but it is probably at 64bits long.
You could check the Microsoft .NET documentation, the string class to see what is the exact max. length of strings.
cncdrive
Site Admin
 
Posts: 5054
Joined: Tue Aug 12, 2014 11:17 pm


Return to Macros

Who is online

Users browsing this forum: No registered users and 9 guests