Jump to content
Developer Wiki and Function Reference Links ×

VectorScript compiler error messages.


Recommended Posts

Hello, I am just getting into VectorScript, and have run into a problem that seems too obvious be be a bug, and can?t find any mention in the documentation as how to proceed. I have written a small script (seen below), and when I try and compile it with the script editors compile button I get a message ?A VectorScript error has occurred. Refer to the file ?Error Output? for a further explanation?. I have tried this in both VectorWorks 11.0.1 and 11.5. I of course expect there to be errors, however when I select the ?View Errors? button or OK button I do not see a list output only an exit back into the script editor. Also there is no file named ?Error Output? on the disk. My question to all you script writers is what am I doing wrong [Frown]

PROCEDURE makesin;

VAR

x,y,xdif,ydif,d :REAL;

i :INTEGER;

BEGIN

d:=8.625;

x:=0;

y:=0;

xdif:=d/36;

FOR i:=1 TO 36) DO BEGIN

x:=x+(d/36);

y:=d*sin(Deg2Rad(i*10));

LineTo (x,y);

END;

END;

Mike

Link to comment

Thanks Kevin and ccroft, the script runs fine now, however when I introduce a bad line, say an extra ?( ?on a line, the error is detected by the compiler, but no file named ?Error Output? can be found in my users Application Folder, system Application folder, or any other folder on the disk. When I try and run the bad script I get the expected script error dialogue, but the ?View Errors...? button opens the ?Script Errors? window with no text in the window. It is acting as if the list file is not being created. Is there a switch somewhere that I am missing?

Link to comment

Here's something scary!!! I copied the script as posted to a new VS. I added the Run(makesin) and ran it to see the error message. THE SCRIPT RAN!!! The extra right parenthesis in the FOR statement did not kick an error!?!

Any takers as to why?

Raymond

VW 10.5.0, Mac G4 OS-10.2.8

Link to comment

Usually this behavior is caused when VectorWorks is unable to write the error output file to disk because of some file permissions problem. If the error file is not created on disk, then the error dialog will not be able to display the errors. We are aware of this problem, and will address it in a future version of VectorWorks.

However, in your case it looks like a bug in the VectorScript compiler. If the Run( ) statement is missing, it gets flagged as a script error but nothing is written to the error output file, and consequently no error message is displayed in the dialog. I will enter a bug report for this.

As for the stray right parenthesis in the FOR statement, that looks like a VS compiler bug also. It is being ignored and probably should be caught as a syntax error. Note that stray right parens in other statements are correctly indicated as syntax errors, it is just the FOR statement that is affected.

Thanks,

Jeff

Link to comment

I noticed several places where the compiler seems to not detect syntax errors such as when you place a ?;? after the BEGIN statement in my example. The compiler ignores the character. Its OK in that it does not cause a problem however it makes me wonder if there are detection errors that might cause odd behaviour without being detected.

On the ?Error Output? file write error does VectorWorks try and write it in the users Application folder or the system Application folder? I would think it would try and write to /me/document/VectorWorks/Error Output> there should be no permissions problem with this destination. Writing to /VectorWorks/Error Output> would cause a write error unless the user had admin permissions. Writing to the system Applications folder should not be done unless the information is to be used by all users which is not the case for an error file for one users code.

To test the hypothesis I have just changed the permissions for /VectorWorks> to read write, and the error disappears. VectorWorks is writing to the system, not the user. Naughty, naughty. : )

Link to comment

Yes, I know. Applications are not supposed to write to the Applications folder. We are investigating how we can be better citizens in a multi-user environment, and may change how we handle flies in a future version of VectorWorks.

Jeff

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...