Xbase++ forum

This forum is meant for questions about the XBase++ Language support in X#.

Post Reply

Xbase++ forum

Post by Anonymous »

Xbase++ support is in development by the X# Team. If you have a strong interest in joining the early development stage, please join the FOX program to gain access to the Private discussion forum.
User avatar
Posts: 1
Joined: Fri Sep 16, 2022 8:23 am

Some questions about migrating from Xbase++

Post by DenGhostYY »

Hello. Please answer my questions.[*]
[*]What function do you plan to implement? What Xbase++ documentation do you rely on? We need to know about this in order to migrate from Xbase++ to X#.
[*]Why did you deprecate functions Error(), Inkey()? What functions then to use instead of them?
[*]There is function Int() in Xbase++. I found a X# function Integer(), read the tip, however questions remain. What happens if the number is greater than the short?
What is the best way to get around this error?
It seems to me that just entering such the UDC is wrong.

Code: Select all

#xtranslate int(<x>) => integer(<x>)
X# Compiler version (public)
-dialect:xBase++ -xpp1 -lb -memvar -vo1 -vo3 -vo5 -vo10 -vo15 -vo16

Code: Select all

procedure Main()
    ? int(12.4) // error XS0103: The name 'int' does not exist in the current context
User avatar
Posts: 3459
Joined: Mon Nov 02, 2015 5:07 pm

Some questions about migrating from Xbase++

Post by wriedmann »

PMFJI, but even if I'm not from the development team: you are waiting for an answer. A part from the fact that is weekend now: I can give you some sort of answer I could immagine one of the team members could give.
First the easy one: Inkey() and the other functions make only sense in a character mode application, and X# does not supports them. If you are using things like Inkey() in a console/command line application: the .NET Framework offers a System.Console class with static methods like ReadLine() and ReadKey():
https://learn.microsoft.com/en-us/dotne ... le.readkey
https://learn.microsoft.com/en-us/dotne ... e.readline
You can build your own function library to implement that function. The same could be made for the Int() function. And you are asking what is occurring when a value is too large for a function? Try it out, IMHO that is the most simple and fast thing (at least I would do that).

Regarding the functions to implement: the X# project is request driven. If you need a function that is not in the library, request it, or better, show code to implement it.
In your situation, if you have a large Xbase++ application to migrate, contact Robert and hire him for a day or more to look at your code, and then he can help you.
Or you can even pay him and his team for creating what you need. After all, it is an open source project and the development team needs to eat and to pay their bills.
Currently the projects has some larger sponsors and many small ones (the FoX members, including myself).

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

Xbase++ forum

Post by robert »


1) So far we have implemented the functions that our customers needed and asked for. If you are missing functions, please let us know. We will try to implement them then. Of course, you can also implement missing functions yourself and share them with us.

2) The Error() function in Xbase++ is the class function of the Error class. In .Net there normally is no "Class Function". This is something from Xbase++ (and Classs(y) in Clipper). The Inkey() function is used in Terminal based applications. X# is normally used to write either console apps, or Windows apps. In these contexts, Inkey() does not make sense. We do not plan to support writing terminal applications. The only exception is the ? (Qout) and ?? (QQout) that write to the console. SET CONSOLE and SET ALTERNATE are supported for this.

3) The function Int() was dropped in Visual Objects, because there is also a type with the name Int() and the expression Int(<something>) meant either cast a value to Int or dereference a pointer to an integer.
We an add that function in the Xbase++ runtime library if you depend on it.
Integer() should return the same results.
I am not sure why you are referring to Short in your question. If the value you send in to the function is between Int32.MinValue and Int32.MaxValue then the function returns an Int32 value. Otherwise it returns a float without fraction. That is why the return type of Integer() is not Int32 (or Int64) but USUAL.

XSharp Development Team
The Netherlands
Post Reply