fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC: VO Select Problem

VO Select Problem 8 months 3 days ago #1

  • Ивайло Кантурски
  • Ивайло Кантурски's Avatar Topic Author
  • Offline
  • Posts: 5
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.
                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

Please Log in or Create an account to join the conversation.

Last edit: by Ивайло Кантурски.

VO Select Problem 8 months 3 days ago #2

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1423
  • Karma: 6
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 3 days ago #3

  • Ивайло Кантурски
  • Ивайло Кантурски's Avatar Topic Author
  • Offline
  • Posts: 5
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?

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 3 days ago #4

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1423
  • Karma: 6
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:
#include "C:\Program Files (x86)\Vulcan.NET 4.0\Include\DBCmds.vh"

That file includes the needed preprocessor definitions.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 3 days ago #5

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
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 2 days ago #6

  • Ивайло Кантурски
  • Ивайло Кантурски's Avatar Topic Author
  • Offline
  • Posts: 5
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?

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 2 days ago #7

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1423
  • Karma: 6
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 1 day ago #8

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1423
  • Karma: 6
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 15 hours ago #9

  • Ивайло Кантурски
  • Ивайло Кантурски's Avatar Topic Author
  • Offline
  • Posts: 5
Hello,

i rewrite the code because i don't want to use .vh externals
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:\XSharp\Dev\Roslyn\src\Compilers\CSharp\Portable\CommandLine\CSharpCompiler.cs:line 63
at LanguageService.CodeAnalysis.CommonCompiler.RunCore(TextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) in C:\XSharp\Dev\Roslyn\src\Compilers\Core\Portable\CommandLine\CommonCompiler.cs:line 530
at LanguageService.CodeAnalysis.CommonCompiler.Run(TextWriter consoleOutput, CancellationToken cancellationToken) in C:\XSharp\Dev\Roslyn\src\Compilers\Core\Portable\CommandLine\CommonCompiler.cs:line 479
at LanguageService.CodeAnalysis.XSharp.CommandLine.Xsc.<>c__DisplayClass2_0.<Run>b__0(TextWriter tw) in C:\XSharp\Dev\XSharp\src\Compiler\xsc\Xsc.cs:line 58
at LanguageService.CodeAnalysis.CommandLine.ConsoleUtil.RunWithUtf8Output[T](Func`2 func) in C:\XSharp\Dev\Roslyn\src\Compilers\Core\CommandLine\ConsoleUtil.cs:line 26
at LanguageService.CodeAnalysis.CommandLine.ConsoleUtil.RunWithUtf8Output[T](Boolean utf8Output, TextWriter textWriter, Func`2 func) in C:\XSharp\Dev\Roslyn\src\Compilers\Core\CommandLine\ConsoleUtil.cs:line 51
at LanguageService.CodeAnalysis.XSharp.CommandLine.Xsc.Run(String[] args, BuildPaths buildPaths, TextWriter textWriter, IAnalyzerAssemblyLoader analyzerLoader) in C:\XSharp\Dev\XSharp\src\Compiler\xsc\Xsc.cs:line 58
at LanguageService.CodeAnalysis.CommandLine.DesktopBuildClient.RunLocalCompilation(String[] arguments, BuildPaths buildPaths, TextWriter textWriter) in C:\XSharp\Dev\Roslyn\src\Compilers\Shared\DesktopBuildClient.cs:line 66
at LanguageService.CodeAnalysis.CommandLine.BuildClient.RunCompilation(IEnumerable`1 originalArguments, BuildPaths buildPaths, TextWriter textWriter) in C:\XSharp\Dev\Roslyn\src\Compilers\Shared\BuildClient.cs:line 93
at LanguageService.CodeAnalysis.CommandLine.DesktopBuildClient.Run(IEnumerable`1 arguments, IEnumerable`1 extraArguments, RequestLanguage language, CompileFunc compileFunc, IAnalyzerAssemblyLoader analyzerAssemblyLoader) in C:\XSharp\Dev\Roslyn\src\Compilers\Shared\DesktopBuildClient.cs:line 49
at LanguageService.CodeAnalysis.XSharp.CommandLine.Program.Main(String[] args, String[] extraArgs) in C:\XSharp\Dev\XSharp\src\Compiler\xsc\Program.cs:line 35
at LanguageService.CodeAnalysis.XSharp.CommandLine.Program.Main(String[] args) in C:\XSharp\Dev\XSharp\src\Compiler\xsc\Program.cs:line 31

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 15 hours ago #10

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1423
  • Karma: 6
Hello,

it'a a long time since I use DBUseArea() the last time - using DBServer classes all the time.
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 15 hours ago #11

  • Ивайло Кантурски
  • Ивайло Кантурски's Avatar Topic Author
  • Offline
  • Posts: 5
We use Vo2AdoRdd (SQL) and "::" is required to set the catalog depends of data source (Oracle or SQL). I'm not sure that "DBUSEAREA" cause XSC.EXE to crush. May be some part of code after calling of "DBUSEAREA"

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 15 hours ago #12

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1423
  • Karma: 6
Hello,

unfortunately I have no experience with the VO2Ado RDD so I cannot help you further.

I may be wrong, but the documentation of VN2Ado Build 4.30.401 states:

The Vn2Ado RDD is not available. We are not sure if we will create such an RDD. Please contact
us if you are interested in the RDD


I don't know if such a RDD was build later - my version is from September 2015.

You cannot use a VO RDD with X#, but you need a .NET RDD.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

VO Select Problem 8 months 14 hours ago #13

Hello,

This must be a compiler bug, but unfortunately I cannot reproduce it here with the code that you posted. Can you please zip the full code and post it here or send it to me (chris at xsharp.eu) to have a look? I am sure it will be easy to find a quick fix for this so you can continue testing.

Also please note that in addition to what Wolfgang said, DBSelectArea() returns a LOGIC value, so you need to remove the "== 0" part.

Chris
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Last edit: by Chris.
  • Page:
  • 1