DTOR()

This forum is meant for questions about the Visual FoxPro Language support in X#.

Post Reply
User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

DTOR()

Post by kevclark64 »

The DTOR() function does not appear to be working properly. For example, DTOR(180) should return 3.14, but it actually returns 1.57.
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

DTOR()

Post by FFF »

Even in Core i see the 1.57.
Strange enough, in X#/VO Dialect it doesn't compile:error XS0118: 'dtor' is a namespace but is used like a variable
EDIT:
in Git there is:
FUNCTION DToR(nDegrees as USUAL) AS REAL8
RETURN (REAL8) nDegrees/ 360 * Math.PI
so, either (REAL8) nDegrees / 360 * Math.PI * 2
or
RETURN (REAL8) nDegrees / 180.0 * Math.PI

EDIT2: Similiar in RtoD()
FUNCTION RToD(nRadian as USUAL) AS REAL8
// RETURN ((REAL8) nRadian / Math.PI) * 360.0
better:
RETURN ((REAL8) nRadian*180.0/Math.PI)

EDIT3: Wanted to save some time for dev, creating an issue at git - but either i'm to stupid for them or their account creation tool is abysmal. So, sorry, no deal ;)
EDIT4: Succeded - they send a "verificate your email" - but don't tell you in advance. So, "in", and issue added.
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
Chris
Posts: 4922
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

DTOR()

Post by Chris »

Guys,

Thanks for reporting this, problem is fixed now as you suggested! It's too late to include this in tonight's new quickfix build, but Kevin if you need a quick fix for this, I can send you a new dll afterwards.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

DTOR()

Post by kevclark64 »

Chris, I don't need a quick fix; but thanks for addressing this.

Kevin
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

DTOR()

Post by FFF »

Chris,
out of curiosity: What does the compile error mean?
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
Chris
Posts: 4922
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

DTOR()

Post by Chris »

Hi Karl,
FFF wrote:Chris,
out of curiosity: What does the compile error mean?
No idea, I do not get this error at all! :)
If you'd like, please post a repro sample and I will have a look.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
FFF
Posts: 1581
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

DTOR()

Post by FFF »

See attached versions. dtor has error, dtor2 has not. Both x#-runtime apps from gallery. The first one has had some swaps between dialects, if that means something ;)
Attachments
Applications.7z
(1.47 KiB) Downloaded 84 times
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
User avatar
Chris
Posts: 4922
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

DTOR()

Post by Chris »

Hi Karl,

Ah, thanks, that's because the app name is the same with the function name, this is not allowed. I will log this as a problem, to improve the error message to make it clear what the problem is.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply