xsharp.eu • RAt() and ChrTran() functions - Page 2
Page 2 of 2

RAt() and ChrTran() functions

Posted: Wed Apr 22, 2020 4:57 pm
by robert
Kevin,
That will not be possible in X#. Just two curly braces is an empty literal array.

Robert

RAt() and ChrTran() functions

Posted: Wed Apr 22, 2020 5:57 pm
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

RAt() and ChrTran() functions

Posted: Thu Apr 23, 2020 6:29 am
by Zdeněk Krejčí
In FP-DOS and also FVP works also {..}

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

Empty date is not null.

RAt() and ChrTran() functions

Posted: Sun Apr 26, 2020 7:04 pm
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

RAt() and ChrTran() functions

Posted: Mon Apr 27, 2020 9:18 am
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.