LarryO Posted March 24, 2015 Share Posted March 24, 2015 It would appear that assigning a parameter to a dynarray of char is not possible. My parameter PSizeH4L is up to 16 characters long from a predefined pop-up list. The assignment := in following doesn't seem to pass a value: VAR StudLength:DYNARRAY[]OF CHAR; BEGIN StudLength:=PSizeH4L; DELETE(StudLength,1,6); MESSAGE('Length= ',Studlength); END; BUT the following does work VAR StudLength:ARRAY[1..16]OF CHAR; TempDynArray:DYNARRAY[]OF CHAR; BEGIN StudLength:=PSizeH4L; TempDynArray:=StudLength; Delete(TempDynArray,1,6); StudLength:=TempDynArray; MESSAGE('Length= ',Studlength); END; Also is there some reason that ALLOCATE TempDynArray[1..16]; crashes VW2013 when used in a point plugin object? Thanks. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted March 25, 2015 Vectorworks, Inc Employee Share Posted March 25, 2015 DYNARRAY[]OF CHAR will automatically allocate itself. It's probably crashing because they system and you are both trying to control the space allocation. I did a quick test in 2015 and I did not see any issues assigning a parameter value to a Dynarray of Char. tempshape : Dynarray[] of Char; tempshape := pShape; AlrtDialog(tempshape); I'm not doing any character manipulation but the simple assignment works correctly in 2015. Quote Link to comment
LarryO Posted March 27, 2015 Author Share Posted March 27, 2015 Thanks Kevin. It must be some quirk in VW2013. The work around will have to do. I'll just need to remember if I have a similar situation in the future. I took 3-4 hours to investigate thinking I made some kind of mistake, even though the complete script compiles without error. With the exception of attempting to allocate the variable some memory before its first use. That crashed VWs as soon as I closed the script window. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.