RAt() and ChrTran() functions

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

User avatar
robert
Posts: 4558
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

RAt() and ChrTran() functions

Post by robert »

Kevin,
That will not be possible in X#. Just two curly braces is an empty literal array.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

RAt() and ChrTran() functions

Post by Karl-Heinz »

Kevin Clark wrote:FYI, in Foxpro you don't need the slashes for an empty date. The open and close curly brackets by themselves do the same thing.
indeed, my FP-DOS results are:

Code: Select all

d = {}
? Dtoc ( d )  && "  .  .    " 
:woohoo: :blink: :silly:

regards
Karl-Heinz
User avatar
Zdeněk Krejčí
Posts: 19
Joined: Wed Sep 04, 2019 8:07 am

RAt() and ChrTran() functions

Post by Zdeněk Krejčí »

In FP-DOS and also FVP works also {..}

Set date german
d={..} && empty date

Empty date is not null.
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

RAt() and ChrTran() functions

Post by Karl-Heinz »

@Robert/Chris

In the attachment there are two new functions.

Code: Select all

FUNCTION MDY ( tExpression AS DateTime ) AS STRING 
FUNCTION MDY ( dExpression AS DATE ) AS STRING 
	
FUNCTION DMY ( tExpression AS DateTime ) AS STRING 
FUNCTION DMY ( dExpression AS DATE ) AS STRING   
When i pass a invalid date my localized FP-DOS doesn´t throw a exception but returns the german error text "*Ungültiges Datum*". Currently both functions return the hard coded text "*invalid date*". I think VFP needs, like VO, nation dependent resources where such error texts are stored.

A few days ago I opened a ticket about the current At() and AtC() behavior.

https://github.com/X-Sharp/XSharpPublic/issues/365

I added the mentioned changes and some At() and AtC() tests to the viaef.

regards
Karl-Heinz
Attachments

[The extension viaef has been deactivated and can no longer be displayed.]

User avatar
Chris
Posts: 4978
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

RAt() and ChrTran() functions

Post by Chris »

Hi Karl-Heinz,

Thanks a lot for the fixes!

I have now adjusted the XIDE project file for the runtime in Git, so you can now test your changes against the existing test suite, enter new tests in the necessary format with Asserts etc.

Can you please pull the latest changes, open Runtime.xiproj and see if everything compiles without errors (except for the MacroCompiler)? Then can you run the tests and see if they all pass (except for just a few related to dbfs currently)?

When you are set, please have a look at one of the tests in the project, for example DevRtRuntimeXSharp.VFP.TestsStringTests.prg, then you can create new ones in the same format, so they can be added directly to the suite.
Chris Pyrgas

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