English
Forum

my dog has a Tasche (Arrays in classes)

 
- Page 1 -



Dean
Wood
Hi,
I Search after a Possibility Arrays on a instance To link, ausgehend of example in the Doku:
Class dog = date of birth$(10), \
strain$(32),        \
Groesse%,          \
bark@, \
tasche$[8,1]

unfortunately shining that not To functions, Perhaps have your a Solution on The I straight not come.

DeanWood.
 
Phantasie ist nicht Ausflucht. Sich etwas vorstellen heißt, eine Welt bauen, eine Welt erschaffen. Eugène Ionesco
01/23/13  
 



« this Posting watts as Solution marked. »


RGH
Oh, there were even yet some Error drin, The me even but neither auffielen:

1. The Konstruktor-method must too in the Methodenliste the Klassendefinition stand. unless, becomes tappt im dunkeln never called. .id& has then means 0 and it'll then ex XProfan X2 The ListboxListe used. with XProfan 11 was not yet the case and accordingly result your Error Message. there .sache& then too 0 is ...

2. The method Content has einenm Parameter. this ought to in the Hauptprogramm too indicated will be, You want whom first entry see? this has whom index 0. so functions it too with XProfan 11:
Class Tasche = sache&,\
id&, \
tasche@,\
hinzu@,\
content@

proc Tasche.Tasche

    .sache& = Create("List",1)
    .id& = Create("List",1)

endproc

proc Tasche.hinzu

    parameters idnr$,bzsache$
    @AddStrings(.id&,idnr$)
    @AddStrings(.sache&,bzsache$)

endproc

proc Tasche.content

    parameters idnr%
    declare row$,row2$
    row$ = @GetString$(.sache&,idnr%)
    row2$ = @GetString$(.id&,idnr%)
    row$=$ row+":"+row2$
    return row$

endproc

CLS
declare TobysTasche#
TobysTasche# = @New(Tasche,1,1)
TobysTasche#.hinzu("1","Knochen")
Print TobysTasche#.content(0)
waitinput

Greeting
Roland
 
XProfan X2
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
01/24/13  
 



I saaach time its what's it like -

there's in XProfan no Arrays as quality/ element of/ one class.

Nimm vlt. simply one Long and in the Konstruktur one CreateList.
 
01/23/13  
 



look time about Text-Adventure I had to years something...  [...] 

Should naturally on News XProfan adjusted/ rewritten go.
 
01/23/13  
 




Dean
Wood
thanks, then such I now not any more frantic into incorrect direction and can to others Solutions ausschau hold, as of you suggested.

If not all To plenty Space in the Tasche the Hundes gives, can it indeed static concern falls me straight one, to that example:

In one mehrdimensionalen aray what elsewhere definiert can Yes then any "Dinge" of/ one eindeutigen Bezeichnung zuordnen and accordingly then The Bindung on The jeweilige instance effect. would be Although a little umständlich should but functions.

DeanWood.

Nachtrag:
nonsense *klatschmirvordenKopf* if eachone dog a Tasche own and any dogs by name famous are, How wärs because with of/ one class for Taschen ;)
Herje today entrapments by me The Groschen but too Pfennigweise
 
Phantasie ist nicht Ausflucht. Sich etwas vorstellen heißt, eine Welt bauen, eine Welt erschaffen. Eugène Ionesco
01/23/13  
 



is already correctly.. One not dynamisches mehrdimensionales aray (means with static
Size) can itself but too slight with a eindimensionalem aray herbilden.

but not 8,2 quasi 16.
 
01/23/13  
 




Dean
Wood
Hmm now be I but on the grübeln wieso I me one eindimensionales aray herbeibilden ought to, my Logik went into direction:

thing$[0,0]= ID
thing$[0,1]= Bezeichnung

the can itself then rather inquire found I.

in the instance stünde then even under
PlatzEins to that example the worth of thing[0,0] drin.

Deanwood.
 
Phantasie ist nicht Ausflucht. Sich etwas vorstellen heißt, eine Welt bauen, eine Welt erschaffen. Eugène Ionesco
01/23/13  
 



the would quasi gleichbedeutend with:

Class dog = date of birth$(10), \
strain$(32), \
...
sachen_bezeichnung&,\
sachen_wert&,\
...
bark@, \

and in the Konstruktor for 2 sachen_ one createList.

so is always getString$(this->sachen_bezeichnung&,id) slight too the worth by
getString$(this->sachen_wert&,id) ermittelbar -

So how one 2 dimensionales Stringarray only even 2 Stringarrays.

so any properties the things over the same Key/ ID accessible
only even from 2 different Arrays.
 
01/23/13  
 




Dean
Wood
somehow see I the benefit not, The Solution would immernoch static there Yes on two static eindimensionale Arrays zugegriffen go would and if one this inside the class power would one Yes then

...
sachen_platzEins_bezeichnung&,\
sachen_platzEins_wert&,\
sachen_platzZwei_bezeichnung&,\
sachen_platzZwei_wert&,\

...

because the dog has Yes several things thereby on The zugegriffen go but should Perhaps is it today too To late what about me kapiers simply not any more ;)

DeanWood.
 
XProfan 9
Phantasie ist nicht Ausflucht. Sich etwas vorstellen heißt, eine Welt bauen, eine Welt erschaffen. Eugène Ionesco
01/23/13  
 



The "Vorteil" would simply the You as much as you want things mitschleppen can and only
per quality of/ one thing a list need.
 
01/23/13  
 




Dean
Wood
now Have I it geschnallt, in the class becomes a list from two eindimensionalen Arrays created, therefore that The list inside the class prepares becomes is tappt im dunkeln dynamic as well as Instanzgebunden and accordingly erweiterbar, what letztlich to follow has I each burst not any more with own variables deklarieren must.

I say still, it lasts a little bit longer by me today ^^

thanks,
DeanWood.
 
Phantasie ist nicht Ausflucht. Sich etwas vorstellen heißt, eine Welt bauen, eine Welt erschaffen. Eugène Ionesco
01/23/13  
 




Dean
Wood
I Have here How frantic to createList sought, To I feststellte that it The function only through XPSE gives
 
XProfan 9
Phantasie ist nicht Ausflucht. Sich etwas vorstellen heißt, eine Welt bauen, eine Welt erschaffen. Eugène Ionesco
01/23/13  
 



Löl. not integrally. Nativ heist The function in xpse createList in nProcs and the not-
native Variante heist in XProfan simply create("List",...

as xpse-User can but in not-nativen area createList write
as well as createWindow or createText etc. there it this automatically to create("...
umwandelt.
 
01/23/13  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

20.435 Views

Untitledvor 0 min.
Langer01/02/21
RudiB.04/16/20
Jörg Sellmeyer05/19/18
lange-jens12/03/13
More...

Themeninformationen

this Topic has 3 subscriber:

Dean Wood (13x)
iF (9x)
RGH (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie