Skip to content

Posts from Programming

5.0 (1 rating)
User Avatar
12 years ago
Auto-translated
Borland C++

Garbage.

From a practical point of view, Visual Studio is much more appealing.
Смысла нет, но вы держитесь там. Удачи, здоровья, хорошего настроения!
И пока в кармане пачка милкиуэйев - значит все не так уж плохо на сегодняшний день



User Avatar
12 years ago
Auto-translated
moment, okay, but if you write me a Heroes 1 script (to start with, in machine code, not ASM), I'll come and give you all my money in person)))
User Avatar
12 years ago
Auto-translated
Ment, here you go) that's why it's easier in assembly.
By the way, I don't remember when or on which resource, but I read how one reverse engineer restored a pirated(!) campaign in Heroes 3 when there was a bug when loading resources and the game crashed. He fixed it and played it)
And there was also a dump of Heroes 3) and a bit of analysis of the mechanics.
User Avatar
12 years ago
Auto-translated
Ment, here you go) that's why it's easier in assembly.
But the best thing is to use both at the same time! You can't create a large, hacked program in assembly, and you won't understand it in binary code.
 

К А
Стикеры GBF в Telegram
User Avatar
11 years ago
Auto-translated
Sorry, I've searched the entire internet and only found a description of my problem in one place, but they didn't offer any advice at all :( Maybe someone here has encountered similar nonsense. I need to add several fields to a dbf file using C++ Builder (6) or Pascal Delphi (6) (via BDE!!!), and the problem is that when I create the dbf table, floating-point fields have only 4 decimal places, but I need more :( I thought this could be solved by setting the Precision property, but no, it always results in only 4 digits after the decimal point, regardless of this property. And if I set the Size property, it actually throws an error for ftFloat. :( In short, a field is created with a size of 20 and 4 decimal places, it's enough to make me bang my head against the wall! What should I do here, how do I set the precision, does anyone know?

int i;
TTable *Table1=new TTable(this);
TTable *Table2=new TTable(this);
if(Form1->OpenDialog1->Execute())
{
Table1->TableName=OpenDialog1->FileName;
Table1->Active=true;
Table2->TableName="temp.dbf";
Table2->TableType=ttFoxPro;
for(i=0; iFieldCount; i++)
{
Table2->FieldDefs->Add(Table1->FieldDefs->Items->Name, Table1->FieldDefs->Items->DataType, Table1->FieldDefs->Items->Size, Table1->FieldDefs->Items->Required);
if(Table1->FieldDefs->Items->DataType==6)
{
Table2->FieldDefs->Items->Precision=8; // How I'm trying to set the number of digits after the decimal point in the dbf file field, but it doesn't work at all
}
}
Table2->CreateTable();

Table2->Active=true;
Table1->First();
Table2->First();
while(!Table1->Eof)
{
Table2->Edit();
Table2->Insert();
for(i=0; iFieldCount; i++)
{
Table2->Fields->FieldByName(Table1->FieldDefs->Items->Name)->AsString=Table1->Fields->FieldByName(Table1->FieldDefs->Items->Name)->AsString;
}
Table2->Post();
Table1->Next();
}
Table1->Active=false;
Table2->Active=false;
}
Attachments 2
2 files attached • Total size: 225.0 KB
Всё не так плохо как Вы думаете. Всё намного хуже!
User Avatar
11 years ago
Auto-translated
Oh, I haven't worked with databases. Hermit, my question is, is the entire integer part of the number fully utilized, for all 20 digits? If there's some room for improvement, you could store additional fractional digits in the integer part. By the way, this would only require one digit: for example, you could use the very first digit to indicate how many digits from the fractional part are carried over to the integer part (0-9, nine should be enough), and then use the remaining digits for the actual digits, whether they are integer or fractional, depending on... In total, this would use 19+4=23 digits for the integer and fractional parts of the number, with the fractional part having up to 13 digits. But honestly, this is just a workaround.
P.S. By the way, I just invented a floating-point number; I'm a genius, to hell with all of you!
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
11 years ago
Auto-translated
Yes, this file will later be used to load into another program, so what you suggested won't work. If I were doing it for myself, there wouldn't even be a question.
Всё не так плохо как Вы думаете. Всё намного хуже!
User Avatar
11 years ago
Auto-translated
Formulate the request in English and search on Stack Overflow.
..разым двазым трызым рызым пята лата сигерь мата локом боком крюк за крюк из бульмы бульма урюк..
Знание некоторых закономерностей освобождает от изучения многих фактов.
Мечты сбываются рано или поздно, так или иначе.
User Avatar
11 years ago
Auto-translated
Yes, this file will be used later to load into another program, so what you suggested won't work. If I were doing it for myself, there wouldn't even be a question.
Is it absolutely impossible to fix it? It's just one line... That's why I don't like collaborative programming.)
Okay, here's another version... Everyone uses Delphi 7, maybe I should try that? Version 6 is really old. Yes, version 7 is also old, but it had very powerful tools for working with databases, I definitely remember that. Maybe it has upgraded properties.
Also, something else. I think it's the database specification itself, but there are several versions... Maybe I should install a module of a newer version? They must have fixed it there. I think so.
I can't suggest anything else; I have version 10-lite installed, and it doesn't even have databases. Although I don't need them.
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
11 years ago
Auto-translated
Ment
Is there really no way to fix this? It's just one line...
Besides this, I don't know any other way to specify the accuracy. I found a description of the same problem on the internet, but they didn't offer any solutions there.
Всё не так плохо как Вы думаете. Всё намного хуже!
User Avatar
11 years ago
Auto-translated
Besides, I don't know any other way to achieve greater accuracy than I've already tried.
I mean, modifying someone else's program. If, of course, it's designed for a specific task.
 

К А
Стикеры GBF в Telegram
User Avatar
11 years ago
Auto-translated
I don't have its source code, and even if I did, I wouldn't be allowed to modify it. And those who create it do so for many institutions, and it's only because of us that the requirements for the data storage format in the uploaded databases would never be changed. As for others, they have their own organizations that provide these databases, and they probably have their own problems, which they likely solve directly with these organizations, not like we do.
Всё не так плохо как Вы думаете. Всё намного хуже!
User Avatar
11 years ago
Auto-translated
By the way, I was solving a puzzle right now, and in the process, I found a solution to my problem. Well, I knew before that I needed to edit the dbf file byte by byte, but now **I know** where the bytes are located that define the number of digits after the decimal point for floating-point numbers in dbf file fields!!!
Всё не так плохо как Вы думаете. Всё намного хуже!

Statistics

Welcome our newest member: recijeb