Hello,
I have now tried to move a VO application I'm working on to X#, using the Vulcan runtime.
But my application fails to deal with index expressions that contain the Descend() function, like these:
upper(artnr)+str(descend(datum),10)
upper(kdnr+artnr)+str(descend(datum),10)
upper(kname+artnr)+str(descend(datum),10)
and several more of them.
Is there anything I can do other than wait for the X# runtime and RDDs?
TIA
Wolfgang
Descend() in index expressions, using Vulcan runtime
Descend() in index expressions, using Vulcan runtime
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Descend() in index expressions, using Vulcan runtime
I seem to remember a lengthy thread in the newsgroup, many moons ago, with the result that descend is broken....?
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Descend() in index expressions, using Vulcan runtime
Hi Karl,
Thank you very much. This means I have to wait until the X# runtime and RDDs are ready.
Wolfgang
Thank you very much. This means I have to wait until the X# runtime and RDDs are ready.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Descend() in index expressions, using Vulcan runtime
Karl, you could very well be right of course, but personally I don't remember this discussion about Descend() being broken. At least there was no open bug report logged about this in when I was a member of the team in the vulcan days, I would had known otherwise.
Wolfgang, can you please give more information? What do you mean it fails, do you get runtime errors, or the sorting is not done correctly? Can you please give us a full repro sample?
TIA
Chris
Wolfgang, can you please give more information? What do you mean it fails, do you get runtime errors, or the sorting is not done correctly? Can you please give us a full repro sample?
TIA
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Descend() in index expressions, using Vulcan runtime
Chris,
that's why is said "seem to remember" - if right, it was way before VN appeared. I think Steph(?) and Geoff were involved. As i hadn't use for it, i never bothered to check for relevance.
Karl
that's why is said "seem to remember" - if right, it was way before VN appeared. I think Steph(?) and Geoff were involved. As i hadn't use for it, i never bothered to check for relevance.
Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Descend() in index expressions, using Vulcan runtime
Hi Chris,
I have to isolate the code as it is deep in my class library, and only orders that contain descend() are atfected, and all of them.
The same code works in VO for at least 10 years now, but since that is an application I'm currently working on I have tried to move it to X#.
Wolfgang
I have to isolate the code as it is deep in my class library, and only orders that contain descend() are atfected, and all of them.
The same code works in VO for at least 10 years now, but since that is an application I'm currently working on I have tried to move it to X#.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Descend() in index expressions, using Vulcan runtime
Wolfgang,
Did you try descend(dtos(datum))? datum is first converted to string and then descend is called.
Guy
Did you try descend(dtos(datum))? datum is first converted to string and then descend is called.
Guy
Descend() in index expressions, using Vulcan runtime
Hi Guy,
I cannot change that as this is part of a more than 10 year old VO application, and if I change the index expressions, I will have to change also the application itself.
Wolfgang
I cannot change that as this is part of a more than 10 year old VO application, and if I change the index expressions, I will have to change also the application itself.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Descend() in index expressions, using Vulcan runtime
Hi Chris,
I was now able to reproduce the issue in a small sample:
The following index expression works:
and the following fails with a runtime error:
The runtime error says:
Please find attaches a small console application (as XIDE export file) that creates a small DBF in your c:temppath and then creates the order.
Wolfgang
P.S. for them that are not using XIDE, this is the full sample code:
I was now able to reproduce the issue in a small sample:
The following index expression works:
Code: Select all
DbCreateOrder( "DATEFIELD", cCdxName, "Descend( DateField )" )
Code: Select all
DbCreateOrder( "SDATEFIELD", cCdxName, "Str( Descend( DateField ), 10 )" )
Code: Select all
Vulcan.NET Runtime Error
Error Code: 34 [Data width error]
Error Subcode: 1121 [Data width error]
Subsystem:
Funktion: ORDCREATE
P.S. for them that are not using XIDE, this is the full sample code:
Code: Select all
function Start( ) as void
local cAlias as string
local cDbfName as string
local cCdxName as string
local aStruct as array
local nArea as dword
try
cAlias := "DbfTest"
cDBFName := String.Format( "c:temp{0}.dbf", cAlias )
cCdxName := String.Format( "c:temp{0}.cdx", cAlias )
System.Console.WriteLine( "Creating table " + cDbfName + "..." )
aStruct := ArrayNew( 3 )
aStruct[1] := { "CHARFIELD", "C", 10, 0 }
aStruct[2] := { "NUMFIELD", "N", 10, 0 }
aStruct[3] := { "DATEFIELD", "D", 10, 0 }
DBCreate( cDbfName, aStruct, "DBFCDX", true, cAlias,, false )
if ( nArea := Select( cAlias ) ) > 0
( nArea )->( DBCloseArea() )
endif
if DBUseArea( true, "DBFCDX", cDbfName, cAlias, false, false )
nArea := Select( cAlias )
( nArea )->( DBAppend() )
( nArea )->Charfield := "Hi X#"
( nArea )->NumField := 2018
( nArea )->DateField := Today()
( nArea )->( Dbcommit() )
if ( nArea )->( DbCreateOrder( "CHARFIELD", cCdxName, "Descend( CharField )" ) ) == false
System.Console.WriteLine( "Error creating order!" )
endif
if ( nArea )->( DbCreateOrder( "NUMFIELD", cCdxName, "Descend( NumField )" ) ) == false
System.Console.WriteLine( "Error creating order!" )
endif
if ( nArea )->( DbCreateOrder( "DATEFIELD", cCdxName, "Descend( DateField )" ) ) == false
System.Console.WriteLine( "Error creating order!" )
endif
if ( nArea )->( DbCreateOrder( "SDATEFIELD", cCdxName, "Str( Descend( DateField ), 10 )" ) ) == false
System.Console.WriteLine( "Error creating order!" )
endif
else
System.Console.WriteLine( "Error opening table" )
endif
catch oEx as Exception
System.Console.WriteLine( oEx:Message )
System.Console.WriteLine( oEx:StackTrace )
end try
return
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Descend() in index expressions, using Vulcan runtime
Hello,
an addition: in VO this code works. And the VO help says about Descend():
an addition: in VO this code works. And the VO help says about Descend():
WolfgangThis example uses Str() instead of DToS() since Descend() of a date returns a numeric value
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it