| |
|
|
- Page 1 - |
|
 Jörg Sellmeyer | Wie kann ich am Besten eine variable Anzahl von Longs/Integers in einer Klasse/Struktur speichern. Bisher mache ich das circa eine Liste Create("List"), aber dann sind die Zahlen immer nur als String gespeichert und müssen immer wieder umgewandelt werden. Auf eine Bereichsvariable wird, laut Aiuto, auch wie auf einen String zugegriffen. Eine variable Anzahl von Variablen kann man nicht definieren... Arrays in Klassen sind leider nicht possibile. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 31.08.2008 ▲ |
|
|
|
|
| |
|
- Page 1 - |
|
 Jörg Sellmeyer | Dafür benötige ich dann aber wieder die glpobale Variable C#. Das kann man dann auch einfacher haben. Ich möchte die Longs nur innerhalb der Klasse speichern, ohne zusätzliche Variablen. Also etwa so, nur nicht mit dem Umweg circa Strings. Geht das überhaupt? KompilierenMarkierenSeparierenClass Test = Test@,Inhalt$(1000),Anzahl%,getInhalt@
Proc Test.Test
WhileLoop %pcount
.Inhalt$ = .Inhalt$ + Str$(&(&Loop)) + "|"
.Anzahl% = &Loop
Wend
Return .Inhalt$
EndProc
Proc Test.getInhalt
Parameters Index%
Return SubStr$(.Inhalt$,Index%,"|")
EndProc
Var B# = New(Test,123,345,2434,823) ,...,...)
Print B#.getInhalt(3),B#.Anzahl%
WaitInput
[offtopic]Hab die überflüssigen Beiträge entfernt[/offtopic] |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 31.08.2008 ▲ |
|
|
|
|
 |
eine variable Anzahl
Ist ja die Frage ob "variabel" hier auch "größenoffen" bedeuten soll.
Wenn es einfach sein soll, und eine Maximalgröße kein Problem ist, dann braucht man doch nur ein Long speichern welches das Handle eines Speichers beinhaltet. (So, wie ich das im Prinzip im ScrollControl-Quelltext mache.) KompilierenMarkierenSeparierenSo kann alles lokal in der Klasse abgesichert werden. |
|
|
| |
|
|
|
 Jörg Sellmeyer | Ok - muß ich mir mal GlobalAlloc ansehen. Hab ich bisher noch nix mit gemacht. So eine ungefähre Maximalgröße habe ich schon, daher müßte das funktionieren. Danke. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 31.08.2008 ▲ |
|
|
|
|
 | Die im Grunde 3 verschiedenen Zeilen sinds.  |
|
|
| |
|
|
|
 Jörg Sellmeyer | |
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 31.08.2008 ▲ |
|
|
|
|
 Frank Abbing | Alle meine Dlls arbeiten damit, obwohl Heaps ja nen Tacken schneller sein sollen. Sicher Aberglaube. GlobalAlloc ist übrigens das gleiche wie LocalAlloc. Bevor du noch danach fragst...  |
|
|
| |
|
|
|
 Jörg Sellmeyer | Da würd mich eher interessieren, was Heaps sind...  |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 31.08.2008 ▲ |
|
|
|
|
 | Auch nur Speicher aber dynamischer dank übergeordneter Zuordnung welche aber genau deshalb auch umständlicher ist. Du hast im Grunde ein Handle statt einer Adresse. |
|
|
| |
|
|