Autor Beitrag
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 20.04.11 23:03 
user profile iconjsbach hat folgendes geschrieben Zum zitierten Posting springen:
Wenn ich "BigNum2" in uses einfüge gibt es die Fehlermeldung: Datei nicht gefunden: 'BigNum2.dcu'.
Hast du denn die Datei BigNum2.pas im selben Verzeichnis liegen?
jsbach Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D5 Ent
BeitragVerfasst: Mi 20.04.11 23:32 
Ich will mich natürlich auch selbst bemühen... Mit Hilfe der Delphi-Hilfe ist BigNum2 jetzt unter uses eingebunden. Programm läuft wieder. Jetzt fehlt mir noch das Verstöndnis für "... immer erst eine Instanz anlegen (mit TSJBigNum.Create)..." Was bedeutet das, wo schreibe ich das hin?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 20.04.11 23:36 
Hier z.B. findest du Informationen über Klassen und Objekte:
www.delphi-treff.de/...klassen-und-objekte/
jsbach Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D5 Ent
BeitragVerfasst: Do 21.04.11 13:11 
Also, so habe ich es jetzt verstanden, aber offenbar falsch. Ich brauche WIRKLICH ganz konkrete Hilfe per Klartext.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
unit MeineUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Math, BigNum2, StdCtrls;

type
    TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;


const maxi=100;

var
  Form1: TForm1;

  u,i,j,b,k: integer;
  m: extended;
  a,a1,g1,g2,g3,g4,g5: TSJBigNumber;
  Liste: TStringList;
  g: array[-maxi..maxi, -maxi..maxi] of TSJBigNumber;


implementation
{$R *.dfm}


procedure TForm1.Button1Click(Sender: TObject);
begin

  Liste:=TStringList.Create;

  // alle Arrays auf Null setzen
  j:=-maxi;
  repeat
    i:=-maxi;
    repeat
      g[i,j]:=TSJBigNumber.Create;     
      g[i,j]:=BMD_StrToBigNum('0',false);  // Fehlermeldung: Inkompatible Typen: 'TSJBigNumber' und 'TBigNumber'
      i:=i+1;
    until i>maxi;
    j:=j+1;
  until j>maxi;
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 21.04.11 14:35 
user profile iconjsbach hat folgendes geschrieben Zum zitierten Posting springen:
Also, so habe ich es jetzt verstanden, aber offenbar falsch. Ich brauche WIRKLICH ganz konkrete Hilfe per Klartext.
:roll:
user profile iconjsbach hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
1:
2:
      g[i,j]:=TSJBigNumber.Create;     
      g[i,j]:=BMD_StrToBigNum('0',false);  // Fehlermeldung: Inkompatible Typen: 'TSJBigNumber' und 'TBigNumber'
Du kannst das nicht so mischen (und wozu auch?). Entweder TSJBigNumber oder die einzelnen Funktionen, aber nicht beides, du musst dich schon entscheiden...
ausblenden Delphi-Quelltext
1:
      g[i, j] := TSJBigNumber.Create('0', false);					
jsbach Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D5 Ent
BeitragVerfasst: Do 21.04.11 14:59 
ganz ehrlich, da wär ich nie drauf gekommen. danke!
jsbach Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D5 Ent
BeitragVerfasst: Do 21.04.11 15:40 
leider geht es nur tröpfenweise voran, jetzt hakte es bei den funktionen. so geht es wohl nicht:
ausblenden Delphi-Quelltext
1:
2:
a1:=TSJBigNumber.Multiply(g[u-12*b-5,u-12*b], g[12*b-2,12*b]);
a:=TSJBigNumber.Add(a, a1);
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Do 21.04.11 15:59 
user profile iconjsbach hat folgendes geschrieben Zum zitierten Posting springen:
leider geht es nur tröpfenweise voran, jetzt hakte es bei den funktionen. so geht es wohl nicht:
Nein, denn das sind keine Klassenfunktionen... absolute Grundlagen...
ausblenden Delphi-Quelltext
1:
a1 := g[u-12*b-5,u-12*b].Multiply(g[12*b-2,12*b]);					
jsbach Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D5 Ent
BeitragVerfasst: Do 21.04.11 20:58 
Das ergibt bei mir folgende Fehlermeldung:
Inkompatible Typen: 'TSJBigNumber' und 'procedure, untyped pointer or untyped parameter'.
jsbach Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D5 Ent
BeitragVerfasst: Fr 22.04.11 14:40 
ok, das letzte problem habe ich selbst lösen können. sind jetzt halt andere befehle, sum statt add, usw.
jetzt fehlt mir nunr noch die neue ausgabe. bei bignum_lib war es ja: BMD_BigNumToStr(g[16,18],false), doch jetzt bei bignum2? ich probiere jetzt seit zwei stunden rum und kriege es einfach nicht hin...
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19340
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 22.04.11 14:53 
Naja, also so viele Methoden hat die Klasse ja eigentlich nicht...

Aber selbst wenn du die Bedeutung von AsString nicht von alleine erkennst:
Wenn du einmal in der Unit nach BMD_BigNumToStr, das du ja kennst, gesucht hättest, hättest du gesehen, dass diese Funktion in der Klasse nur einmal verwendet wird:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Function TSJBigNumber.AsString(HexOutput: Boolean): String;
Begin
    Result := BMD_BigNumToStr(Self.fNumber, HexOutput);
End;
Du musst also hier nur AsString benutzen.
jsbach Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D5 Ent
BeitragVerfasst: Fr 22.04.11 15:10 
also z.b.: showmessage(g[15,17].AsString); ...juchu, es klappt!