PDA

View Full Version : Numbers of characters


pel
11-20-2006, 12:01 AM
Hi
Does anybody nows the limit of how many characters you can put in a variable ?
It should be very simple to check, but i get differents limits in different situations.
Is there a simple rule to follow ?

LET Example ('This is a test' + CHR(13)
+ 'send to CoCreate User' + CHR(13)
+ 'Forum')

/Pel

John Scheffel
11-20-2006, 09:28 AM
I've done a lot of macro programming but don't remember ever running into a limit, but I don't know if I ever tried to assign a really long string. I checked the manuals and programming help but couldn't find any mention of a limit. How high are the limits that you are running into? What version of ME10/Drafting are you using?

Ron Keeley
11-20-2006, 02:18 PM
I don't know the answer to this one, but I wouldn't be too surprised to find out that there's a limit right around 256 characters or so... And, of course, even if the limit is above that, I'd expect some other limit at around 512 or 1024, or evn 1096 characters (used to be a PATH envirnment variable length limit in ME10/ME30).

pel
11-20-2006, 08:16 PM
Hi

Thank you for your reply. I'm running 13.20b.
The limit i discovered is about 825-1090 characters. It depends on what informations i put in the variable.
I use it to call a *.vbs script. The script is for sending automatic mails attached pdf-files.
It's not something i've made, but i've changed it, so it's possible to attach more than one file. All the information to the *.vbs script i in a variable. (LET Error (WINEXEC ('WScript "' + .....+...) And when you need the full path to every file, you soon reach the limit.
I would rather avoid it, but i probably have to pack the attachments into a zip-file before adding them.

/Pel

John Scheffel
11-27-2006, 04:19 PM
I wrote a small macro to test the limit. It seems to be 1023 characters. I got a "Value range error" when it hit 1023.

Here's a suggestion for working around the limit. Alter the vbscript so that it uses a single parameter which is the name of a text file containing a list of file paths to Email. You can write the list of file paths from your macro to a text file one line at a time using the WRITE_FILE command. Then you can run the vbscript using WINEXEC and pass it the text file name which contains the paths. The vbscript can read the text file one line at a time to get the list of file paths to send. This method would allow a virtually unlimited number of paths. Even if there was no limit on Drafting variable length, I think your current method could run into other limits such as Windows command line length.
DEFINE Test_var_length
LOCAL Count
LOCAL Longstring
LET Count 0
LET Longstring 'X'
LOOP
LET Count (Count+1)
DISPLAY_NO_WAIT Count
LET Longstring (Longstring+'X')
IF (Count>1020)
DISPLAY Longstring
END_IF
END_LOOP
END_DEFINE

Lim Chee Beng
11-27-2006, 09:22 PM
I wrote a small macro to test the limit. It seems to be 1023 characters. I got a "Value range error" when it hit 1023.....

It is 1023. If we try to read a line from a text file which is longer than 1023 characters, the macro will read only the first 1023 characters.