Page 1 of 1

Maximum number of characters per line in a rules file

Posted: Thu Jan 14, 2010 5:45 pm
by kielmc
I'm getting the following error message in my log file:

TM1RuleImpl::LineGet - String overflow error, length = 649

Which tells me I have a line in my rules file that is too long. I did not receive any error messages when saving the rules file, but apparently there is a limit.

Anyone know what the limit is? 256?

Re: Maximum number of characters per line in a rules file

Posted: Thu Jan 14, 2010 6:33 pm
by rkaif
I dont think that there is character limit per Line in a Rule file. But there is a limit for the Comments. See the following from the Rules Manual
Comment length is limited to 255 bytes. For Western character sets, such as English, a single character is represented by a single byte, allowing you to enter comments with 255 characters. However, large character sets, such as Chinese, Japanese, and Korean, use multiple bytes to represent one character. In this case, the 255 byte limit may be exceeded sooner and not actually allow the entry of 255 characters.
Are you using the Advanced rules editor or the Basic one? Also have you tried to shifting your rule in multiple lines?

Re: Maximum number of characters per line in a rules file

Posted: Thu Jan 14, 2010 7:17 pm
by kielmc
Yes the errors in the log file disappear when I break the rule into multiple lines. The real story here is that I'm working on a process to loop through multiple rules files and find and replace a VERY long string (629 characters - using DOS and VBScript). My VBScript won't find and replace the string unless its all on one line.

Anyway, I should be able to search for a smaller portion of the string, but will have to make sure that only the specific instance I want to replace will be replaced...anyway, I thought it was interesting that the rules editor (both advanced and old fashioned) produce no error, but the TM1Server.log does!

I'll bet that the limit for both comments and rules on one line are identical (255).

Re: Maximum number of characters per line in a rules file

Posted: Thu Jan 14, 2010 8:18 pm
by lotsaram
When editing a rule in either rule editor, any line with > 255 characters is broken over multiple lines "behind the scenes" when the rule is compiled/saved. If you are editing the rux file directly or using rule attach in TI then be wary of lines with more than 255 characters.

Can you share any more detail on why you are looping through your rule code with vbscript? It woudl seem very strange to me to have a TM1 model with many repetitive lines of rule code with the same string of >600 characters. What exactly is that piece of code doing and why do you need so much of it? Seems very unusual ...