VO Select Problem

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
User avatar
Ивайло Кантурски
Posts: 7
Joined: Thu Jul 19, 2018 12:17 pm

VO Select Problem

Post by Ивайло Кантурски »

Hello Guys,

could you please help me with the code bellow. I try to build our VO projects but the VO SELECT command is not recognized by the compiler. Thank you.

Code: Select all

                IF SELECT(#T_FORGETCN) == 0
			IF gwMEM_RDD == 3 .OR. gwMEM_RDD == 5 
				use (gcInitialCatalog + "::T_FORGETCN") new via ViaRdd("")
			ELSEIF gwMEM_RDD == 4
				use (gcUserID + "::T_FORGETCN") new via ViaRdd("")
			ENDIF
		ELSE
			SELECT T_FORGETCN
		ENDIF
User avatar
wriedmann
Posts: 3658
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

VO Select Problem

Post by wriedmann »

Hi,

if you are using VO 2.8. you have to include the STD.UDC in the application properties, tabpage "UDCs".

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Ивайло Кантурски
Posts: 7
Joined: Thu Jul 19, 2018 12:17 pm

VO Select Problem

Post by Ивайло Кантурски »

Hello,

i'm using XSharp and convert VO AEF to XSharp code. When i try to compile the project get the error which are related to this code. Do i need to include UDC file in XCode project?
User avatar
wriedmann
Posts: 3658
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

VO Select Problem

Post by wriedmann »

Hello,

do you are using the Vulcan runtime DLLs? Or better, do you have a Vulcan installation on your disk?

If no, you have to wait until the RDDs are released.

If yes, add the following line at the top of your prg file:

Code: Select all

#include "C:Program Files (x86)Vulcan.NET 4.0IncludeDBCmds.vh"
That file includes the needed preprocessor definitions.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4593
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

VO Select Problem

Post by Chris »

Guys,

The Select() function is actually defined in the VulcanRTFuncs.dll file. In the X# runtime, this is not implemented yet, because the X# RDDs are not ready.

So if you have the vulcan runtime, then this code should work already. Otherwise, you will need to wait for a couple months, till we release the X# RDDs and also include the dbf related functions in or runtime.

Chris
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
Ивайло Кантурски
Posts: 7
Joined: Thu Jul 19, 2018 12:17 pm

VO Select Problem

Post by Ивайло Кантурски »

Hello,

thank you for your answers. I use X# at the moment because i don't have the Vulcan redistributables. Just want to check the X# product and verify that we can convert part of our VO code in .NET

Is there way to find somehow Vulcan redistributes?
User avatar
wriedmann
Posts: 3658
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

VO Select Problem

Post by wriedmann »

Hello,
Is there way to find somehow Vulcan redistributes?
I will prepare some migration samples until tomorrow evening, based on the Standard Application and the SQL Standard Application.
That should help to understand the migration process.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3658
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

VO Select Problem

Post by wriedmann »

Hello,

I have now prepared two different samples, together with the VO sources, the X# sources (as XIDE export file) and all needed binaries (X# compiled exe, Vulcan runtime).

The changes to make compile these applications in X# were only a few, and all of them because .NET does not allow methods and access/assign with the same name. Therefore there is not more an access/assign "Font" in the Control class, and you need to replace them with "ControlFont" in exactly 4 (four) places in the AboutDialog code.

After this change, both applications run and open DBF files and (in the case of the SQL version) also ODBC data sources.

You can find the files here:
https://riedmann.it/download/StandardMDI_XS.zip
https://riedmann.it/download/StandardMDISQL_XS.zip

Please note that I have the redistribution rights to the Vulcan Runtime DLLs, but if you don't have a valid Vulcan license, you cannot distribute them to your customers, but you can use them of course to run the application I have delivered.

Please feel free to ask here if you have more questions.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Ивайло Кантурски
Posts: 7
Joined: Thu Jul 19, 2018 12:17 pm

VO Select Problem

Post by Ивайло Кантурски »

Hello,

i rewrite the code because i don't want to use .vh externals

Code: Select all

IF DBSelectArea("T_FORGETCN") == 0
	IF (gwMEM_RDD == 3) .OR. (gwMEM_RDD == 5)
		DBUseArea(true, ViaRdd(""), gcInitialCatalog + "::T_FORGETCN")                
	ELSEIF gwMEM_RDD == 4
		DBUseArea(true, ViaRdd(""), gcUserID + "::T_FORGETCN")
	ENDIF
ELSE
	DBSelectArea("T_FORGETCN")
ENDIF
it's works ok but now XSC.EXE crushed with the error:

Inner Exception 1:
InvalidCastException:
Unable to cast object of type
'LanguageService.CodeAnalysis.XSharp.Syntax.InternalSyntax.EmptyStatementSyntax'
to type 'LanguageService.CodeAnalysis.XSharp.Syntax.InternalSyntax.ExpressionSyntax'.


System.AggregateException
HResult=0x80131500
Message=One or more errors occurred.
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
at LanguageService.CodeAnalysis.XSharp.XSharpCompiler.CreateCompilation(TextWriter consoleOutput, TouchedFileLogger touchedFilesLogger, ErrorLogger errorLogger) in C:XSharpDevRoslynsrcCompilersCSharpPortableCommandLineCSharpCompiler.cs:line 63
at LanguageService.CodeAnalysis.CommonCompiler.RunCore(TextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) in C:XSharpDevRoslynsrcCompilersCorePortableCommandLineCommonCompiler.cs:line 530
at LanguageService.CodeAnalysis.CommonCompiler.Run(TextWriter consoleOutput, CancellationToken cancellationToken) in C:XSharpDevRoslynsrcCompilersCorePortableCommandLineCommonCompiler.cs:line 479
at LanguageService.CodeAnalysis.XSharp.CommandLine.Xsc.<>c__DisplayClass2_0.<Run>b__0(TextWriter tw) in C:XSharpDevXSharpsrcCompilerxscXsc.cs:line 58
at LanguageService.CodeAnalysis.CommandLine.ConsoleUtil.RunWithUtf8Output[T](Func`2 func) in C:XSharpDevRoslynsrcCompilersCoreCommandLineConsoleUtil.cs:line 26
at LanguageService.CodeAnalysis.CommandLine.ConsoleUtil.RunWithUtf8Output[T](Boolean utf8Output, TextWriter textWriter, Func`2 func) in C:XSharpDevRoslynsrcCompilersCoreCommandLineConsoleUtil.cs:line 51
at LanguageService.CodeAnalysis.XSharp.CommandLine.Xsc.Run(String[] args, BuildPaths buildPaths, TextWriter textWriter, IAnalyzerAssemblyLoader analyzerLoader) in C:XSharpDevXSharpsrcCompilerxscXsc.cs:line 58
at LanguageService.CodeAnalysis.CommandLine.DesktopBuildClient.RunLocalCompilation(String[] arguments, BuildPaths buildPaths, TextWriter textWriter) in C:XSharpDevRoslynsrcCompilersSharedDesktopBuildClient.cs:line 66
at LanguageService.CodeAnalysis.CommandLine.BuildClient.RunCompilation(IEnumerable`1 originalArguments, BuildPaths buildPaths, TextWriter textWriter) in C:XSharpDevRoslynsrcCompilersSharedBuildClient.cs:line 93
at LanguageService.CodeAnalysis.CommandLine.DesktopBuildClient.Run(IEnumerable`1 arguments, IEnumerable`1 extraArguments, RequestLanguage language, CompileFunc compileFunc, IAnalyzerAssemblyLoader analyzerAssemblyLoader) in C:XSharpDevRoslynsrcCompilersSharedDesktopBuildClient.cs:line 49
at LanguageService.CodeAnalysis.XSharp.CommandLine.Program.Main(String[] args, String[] extraArgs) in C:XSharpDevXSharpsrcCompilerxscProgram.cs:line 35
at LanguageService.CodeAnalysis.XSharp.CommandLine.Program.Main(String[] args) in C:XSharpDevXSharpsrcCompilerxscProgram.cs:line 31
User avatar
wriedmann
Posts: 3658
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

VO Select Problem

Post by wriedmann »

Hello,

it'a a long time since I use DBUseArea() the last time - using DBServer classes all the time.

Code: Select all

DBUseArea(true, ViaRdd(""), gcInitialCatalog + "::T_FORGETCN") 
AFAIK the 3rd parameter needs to be a pathname, and I don't think "::" can be part of a legal filename.

I cannot say why this code crashes the compiler - must leave this to a member of the development team.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply