Jump to content
Pat Stanford

Delimiters? Different by Language/County?

Recommended Posts

I think my archive might have gotten too big, because I am sure this has been discussed before, but I can't find it.

 

The basic question is:  How can you right a script that will run anywhere if it depends on how things are delimited.

 

In the US we use a period (.) as the decimal point. In many other countries it is a comma (,).

 

In the US we use a comma (,) as the separator in a CSV file, in Europe it is a semicolon (;)

 

I am considering a script that will read the formula out of a worksheet cell [=record.field format] and then I want to be able to extract the record name and field name. I can do that relatively easily using Copy, Pos, and SubString, but only if I am certain what the delimiter character between the two parts of the field are. Is it always a period? Or is it a comma in some languages/countries?

 

Since I think this is actually based on the operating system settings, it is not even a easy as having different versions for different countries as someone could set their OS up differently.

 

How do I determine what delimiters are used or how do I write a script that is delimiter independent?

 

I think I was bitten by this in the last couple of weeks where a script I posted had to have the commas changed to semicolons but I can't find that thread either.  Grrrrr.

 

OK Gurus what am I missing to make this work?

 

Share this post


Link to post

You’re right about the delimiters when it comes to numbers. But for records/fields in Vectorworks worksheets the delimiter is always a period.

Share this post


Link to post
3 hours ago, Pat Stanford said:

I think I was bitten by this in the last couple of weeks where a script I posted had to have the commas changed to semicolons but I can't find that thread either.  Grrrrr.

 

Was the script you posted in my thread “insert values referred to Working Plane in a Worksheet”

I am under the impression that if you send a .vwx file containing the script the separators are always correct. 

Share this post


Link to post

This could probably be solved by VW (allow for) using a tab delimiter as that is probably the delimiter least likely to cause issues in CAD software where delimited lists are involved.

Share this post


Link to post

You can probably sleuth out the decimal indicator by parsing the result of a Num2Str conversion. 
 

In the case of a worksheet formula however, this is a proprietary syntax and I’m fairly sure it doesn’t get localized. 

Share this post


Link to post

Thank you all for the input. I think that is enough for me to move on. For now.

 

Best Regards.

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...