English
Opportunities and suggestions

Proposals for future versions

ENUM

 

Michael
W.
Hm, sees Yes bad from if since the Formatierung verbogen becomes, but I faith now is it discernible.

the ENUM has Yes meanwhile too Java heimgesucht, it'll means not only of me gladly used.

here an example for occupancy in XProfan.
CompileMarkSeparation
// -
enum eBoolean = eFalse, eTrue
// -
enum eJustify = eJustify_Left  \/*0*/
eJustify_Center  \/*1*/
eJustify_Right/*2*/
// -
enum eWeekdays = eWeekday_Sunday, \
eWeekday_Monday, \
eWeekday_Tuesday, \
eWeekday_Wednesday, \
eWeekday_Thursday, \
eWeekday_Friday, \
eWeekday_Saturday
// -
Declare eBoolean bTest
Declare eJustify lJustification
// -
bTest = eTrue
// -

Proc WDtoText

    Parameters eWeekdays eDay
    Var String Klartext = "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday"
    Return SubStr(KlarText, eDay + 1, ",")// Rechnen mit ENUM

EndProc

// -
// Rechnen mit ENUM setzt die Konstante frei, alles OK
// Rechnen in ENUM-Var muß aber innerhalb der Grenzen eines ENUM bleiben; was passiert bei Überschreitung der Grenzen?
Declare eWeekdays eDay
Inc eDay
Dec eDay
// -
// Bewegen innerhalb von ENUM mittels  enumMin() und enumMax()
<kleinster ENUM-Wert> = enumMin(<enumtype>)
<größter ENUM-Wert> = enumMax(<enumtype>)
// -
// erlaubt dann z.B. auch... (intern gesteuert)
ForEach eDay
Print WDtoText(eDay)
EndFor
// -
// oder... (hier müßte das FOR dann auch typisierte Variablen ermöglichen)
For eWeekdays eDay, enumMin(eWeekdays), enumMax(eWeekdays)
Print WDtoText(eDay)
EndFor
// -
// evtl. noch
TestEnum(eVal)
// 
whether the worth inside the border is.



Info: [...] 
 
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
01/09/15  
 



where is the benefit in the comparison To:

var myColorsEnumVar=array("rot","grün","blond")

in link with ForEach... ?
 
01/09/15  
 




Michael
W.
I have aware a function between ForEach staid, so the klarer becomes. It's all right not simply around the Zuweisung. with ENUMs is another little More possible.

too
CompileMarkSeparation
shows already, the The values not always only ascending of 0 stored go. it can also new Startwerte (as here with fair) staid go.

I know the ENUM from Pascal (there heißt's Aufzählungstyp):
CompileMarkSeparation
type
TAmpel = (rot = 1, gelb = 2, gruen = 4);
TArbeitstage = (Mo = 1, Di = 2, Mi = Mo + Di, Don = 4, Fr = Di + Mi);// Mi = 1+2=3, Fr = 2+3=5
TDoppelt = (Bez1 = 1, Bez2 = 2, Bez3 = 3, Bez4 = 2);// sowohl Bez2 als auch Bez4 ergeben mit Ord = 2pre>

Inc/Dec/Ord functions there also (succ/pred)

loan from: [...] 
 
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
01/09/15  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.212 Views

Untitledvor 0 min.
H.Brill10/12/22
Christof Neuß05/06/21
p.specht05/31/18
Michael W.01/28/18
More...

Themeninformationen

this Topic has 2 subscriber:

Michael W. (2x)
iF (1x)


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