English
Forum

values of/ one class Show Class Struct

 

Jörg
Sellmeyer
me was is always To umständlich, extra any Lines einzuprogrammieren, circa me with the development The values of/ one Classenstruktur Show To let.
I Have me therefore what written, with the the very simply machbar is.
it must method To eachone class added and the procedure moreover two Lines adjusted go.
Class tTest = hdl&,\
ID%,\
Index%,\
Text$(100),\
tTest@,\
ShowValues@' The method must naturally in the structure eingefügt go.

Proc tTest.tTest

    Parameters h&,i%,ind%,t$
    .hdl& = h&
    .ID% = i%
    .index% = ind%
    .Text$ = t$

ENDPROC

'these procedure must eingefügt go.

Proc tTest.ShowValues

    Parameters T#,cover$

    If %pCount > 2

        'these row must the jeweiligen code adjusted go
        Var Values$ = "hdl&,\
        ID%,\
        index%,\
        Text$(10)"
        Declare worth$,txt$

        WhileLoop 3,%pcount

            txt$ =SubStr$(Values$,&Loop - 2,",") + " = " + $(&Loop) +  "\n"
            worth$ = worth$ + txt$

        Wend

        MessageBox(worth$,ClassOf(T#) + " " + cover$, 0)

    ElseIf %pcount = 2

        'and these row must the jeweiligen code adjusted go
        .ShowValues(T#,cover$,.hdl&,\
        .ID%,\
        .index%,\
        .Text$)

    EndIf

ENDPROC

Declare Test#[]
Randomize
Cls
Var hTb& = Create("Toolbar",%hwnd,0,0,4,0,0)

WhileLoop 4

    Toolbar("AddButton",hTb&,&Loop,2000 + &Loop,"Text " + Str $(&Loop))
    Test#[&Loop - 1] = New(tTest,hTb&,Rnd(20),2000 + &Loop,"Text " + Str $(&Loop))

Wend

Toolbar("Separator",hTb&)
Toolbar("AddButton",hTb&,5,2005,"Zufallswerte")
Toolbar("AddButton",hTb&,6,2006,"beenden")

While 1

    WaitInput

    If Between(%menuitem,2001,2004)

        Test#[%menuitem - 2001].ShowValues(Test#[%menuitem - 2001],"Bitte anzeigen")

    ElseIf MenuItem(2005)

        Test#[Rnd(4)].tTest(Rnd($FFFFFF),Rnd($FFFF),Rnd($FF),"Zufall " + time$(0) + ":" + time$(1))

    ElseIf MenuItem(2006)

        Break

    EndIf

Wend

Dispose Test#[]
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/19/18  
 




p.specht

cool!
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/19/18  
 




Jörg
Sellmeyer
thanks

in the Context would me yet interested, whether one somehow on The variables of/ one structure comes, without tappt im dunkeln of "innen" aufzurufen.

with Long(Test#,n&) can itself in the principle durchhangeln, if only Longs stored are. but whom area to Values To parsen is useful unmöglich.
gives it means a point, where The Einsprungadressen one Bereichs indicated are and evtl too The Size the jeweiligen Platzes?
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/20/18  
 




p.specht

RGH ask ... becomes but Perhaps To versionsabhängig?
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/20/18  
 




H.Brill
there so one area in the Grunde only one linearer, together
liegender Speicherbereich is, think I do not, that one
there of 'außen' yet differently rankommt. one can indeed
with the normalen Bereichs-command reinschreiben, what
wants. The structure (struct) is only one expedient, particularly too,
if one several Structures in so one area reinschieben
wants. there's then too Rechenarbeit angesagt, or. The length
of/ one such structure is then To respect.
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
05/20/18  
 




Jörg
Sellmeyer
it comes Yes on it on, How Roland the intern manages. The Einsprungadressen for individual Strukturvariablen must Yes at least somewhere stored his.
time see, what Roland moreover says.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
05/20/18  
 




H.Brill
Since there it probably no Einsprungsadressen.
i think time, that Roland The Strukturvariablen intern
of course manages, but whom Content too simply over
calculate the position (byte = 1, Word = 2, Long = 4 etc.)
from the area ausliest or. reinschreibt.

therefore must indeed The Strings in a Struct
one solid Size having. How one on folgendem code
sees, cut Roland with one more String
as in the Struct pretended, simply whom remainder ex.
Declare Mem area
Struct data = Alter&, name$(10), salary%
Dim area, data
Cls

With area

    area.Alter& = 60
    area.name$ = "RGH Author of XPROFAN"
    area.salary% = 10000

EndWith

Print area.Alter&, area.name$, area.salary%
Print
Print Long(area, 0)
Print String $(area, 4)
Print Long(area, 15)' 1 byte More because of Chr$(0)
Waitkey
Dispose area
End

with variables Strings could it The position not any more
so simply calculate, separate should the Nullbyte with
include.

If one something like need, stand Yes still The
normalen Bereichsfunktionen available.
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
05/20/18  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.273 Views

Untitledvor 0 min.
Matzbub02/03/24
Normann Strübli02/05/23
Stringray01/05/22
iF10/31/20
More...

Themeninformationen



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