• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Compiler Doesn't Like Comma "," as Decimal Separator

gadgets

Resource contributor
Messages
9,388
Country
ca-britishcolumbia
SAMM uses the standard FS9 compiler when it places static models.

It seems the compiler doesn't like the comma (",") as a decimal separator. So, when using the SAMM placement facility, please ensure your Windows language/regional settings will use a period (".") as a decimal separator.

The next release of SAMM will ensure a period (".") is used regardless of your language/regional settings.

Don
 
Hi Don,

How can you ensure the dot is used? I tried this in ModelConverterX for XtoMDL, but never found a way to force the dot.
 
Haven't done it yet, Arno. But, my plan is to replace any commas with periods when I read the user-entered lat/lon/etc from the placement dialog.

Are you saying this won't work?

Don
 
Hi Don,

I don't think that will work. The problem is the actual compiler. When the language on the PC is set so that it uses the comma, the input file is parsed with that setting (at least for XtoMDL, I think BGLComp/MakeMDL work the same).

I tried to change the localization of the thread that the compiler runs in from my program, but that seems not possible. So my only solution was to force users to change their settings on the computer. I have added an error to ModelConverterX when the setting is wrong.

But if you find another way to get it working I would be very interested :).
 
Thanks for the input, Arno. If my fix doesn't work, then my advice to users to use language/regional settings that use a period as a decimal seperator will stand. In any case, its not a "big deal" since I think most users use of ADE/ Instant Scenery, etc, to place static models.

Best regards,
Don
 
Arno, as best I can tell, my fix works.

For example, after evaluation, the lat/lon text fields are converted to a double precision number. These numbers are eventually placed in a XML file using the VBNet instructions:

"lat = """ & Replace(nLat.ToString("#0.0#########"), ",", ".") & """" & vbCrLf & _
"lon = """ & Replace(nLon.ToString("#0.0#########"), ",", ".") & """" & vbCrLf & _
"alt = """ & Replace(sAlt_M, "'", ".") & "M""" & vbCrLf & _
.

The C# (or whatever other language) you use should be similar.

Hope this helps,
Don
 
Hi Don,

Which compiler are you using?

I tried the language invariant writing of strings for XtoMDL, but even if the X file has only dots, it still does not work if the system is set to use the comma.

But maybe other compilers are less picky.
 
But I mean is it FS2004 BGLComp or the FS2004 MakeMDL or BGLC_9 or ...
 
Thanks Don. It seems BGLComp is less demanding then, which is good news :).
 
Back
Top