English
Online-Documentation

xpse.syntax Textblock

 
preface

"Syntaktische Erweiterungen" hears itself of course tricky on, means but solely the one and the same differently written go can. The through XPSE gebotenen syntaktischen extensions go of XPSE in "normalen" but optimierten XProfan-View source konvertiert.

One simple Example for a syntaktische expansion:
x&+
'or
x&++
'or
x&-
'or
x&--
becomes
inc x&
x&=x&+1
dec x&
x&=x&-1
konvertiert.

One other Example for a syntaktische expansion anhand of/ one For- Loop, because particularly on this example To discern is - the syntaktische extensions The Overview explicit improve can and/or the write relieve:
declare h&
for h&:=500 downto 200 step 3 do begin
print h&
end
becomes
declare h&
H&=500
WHILE H& >= 200
PRINT H&
SUB H&,3
WEND
H&=200
konvertiert.

Anhand this example becomes The syntaktische expansion the XPSE anhand the Konvertierens of/ one function displayed:
declare h&
cls
h&=createhtmlbox(%Hwnd,
"mshtml:

Info

Testinfo"
,0,0,320,240)
waitinput
destroywindow(h&)
end
becomes
DECLARE H&
USEDLL("ATL.DLL")
EXTERNAL("ATL.DLL","AtlAxWinInit")

PROC _XPSE_CREATEHTMLBOX

    PARAMETERS HDL&,TXT$,XP&,YP&,XW&,YW&
    RETURN CONTROL("AtlAxWin",TXT$,1345323008,
    XP&,YP&,XW&,YW&,HDL&,0,%HINSTANCE,$200)

ENDPROC

CLS
H&=(_XPSE_CREATEHTMLBOX((%HWND),
"mshtml:<html><head></head><body><h1>Info</h1>Testinfo</body></html>",
(0),(0),(320),(240)))
WAITINPUT
DESTROYWINDOW(H&)
END
konvertiert.

Syntaktische extensions

<i>Befehlstrennung</i><b>Kurzfassung:</b> XPSE supported ; and : circa command voneinander To separate.
<b>Die Langfassung:</b>Viele Hochsprachenkompiler afford nowadys the feature the zeilenunabhängigen Parsens the Quelltextes. severe taken is it whom most Kompilern even alike whether the gesammte View source in a individual row, or over mehere Lines distributed is. so this without Umwege possible is there "Befehlstrennungszeichen". into most Hochsprachen is this nowadys the Semikolon. with the Semikolon go command voneinander abgetrennt,- the Compiler must then not any more Zeilengebunden parsen. this can integrally generally with the Programming, with the input and in the reference on The Overview of Quelltexten, many advantages mitsich bring.

its only unfortunately so, that the zeilenorientierten Parser the detach of command with a Befehlstrennungszeichen chiefly not support, and in the Umkehrschluß - The Parser which solely command with Befehlstrennungszeichen expect, no Zeilenorientation mitsich bring. The problem is it now, there XProfan-Programmer it dwelt are on a zeilenorientierten Parser To credit, both in addition To make possible. the XSPE gelang this. XPSE bid since XProfan8 The Possibility command with the gewohnten Befehlstrennungszeichen "Semikolon" To separate - whenever one would like - but with the benefit not To "müssen". RGH implementierte then this feature into hereon following XProfan- Version 9. Seither bid XProfan ditto The Possibility with a Befehlstrennungszeichen command voneinander To separate. however not by Semikolon, separate by colon.

now stood the XPSE naturally on the Prüfstand. it had now not only for care Zeilenorientiert or Semikolongetrennt To parsen, separate it coming too another second Befehlstrennungszeichen moreover - which correctly processing go had. The problem is, there XProfan indeed inside the own Syntax on manchen to put Semikolons and Doppelpunkte expects, nevertheless very discern to when one new commands begins. the XPSE gelang too this. with the XPSE can even within of/ one only row wild between whom Befehlstrennungzeichen changed go. even instructions How Case (which a colon expects) or SetWindowpos (which one Semikolon expects) [and all the rest of them command which one or several Semikolons expect) go at wildly mix of Befehlstrennungszeichen always correctly. recognized. its me no Erkennungsfehler famous and the application this Features a permanente joy.

>export exportProcedures / functions in Units go of XPSE automatically in a .def File written - be because - it'll the Schlüsselwort noexport on whom Prozedurnamen "With Freizeichen getrennt" angehangen. to Support of Unit-Programmierern there the Schlüsselwort "export". though XPSE each "nicht-with-noexport-gekennzeichnete" procedure/function into .def-File writes - bid XPSE with the Schlüsselwort "export" The Possibility, the a manner Hilfetext for jeweilige with "export" marked procedure anzufügen. this Hilfetext becomes into .hlp.htm- File written.

these very helpful if one itself one nachträgliches write of/ one Helpfile save would like. look at too whom Kompilerschalter {$preferednamespace }.
'example:

proc ?_sid export "Erstellt a manner SessionID and gives these as String zurück"

    declare s$,o%
    o%:=get("Decimals")
    set("Decimals",0)
    s$:=(date$(3)+del$(time$(0),3,1)+del$(time$(1),3,1)+st$(&gettickcount))
    set("Decimals",o%)
    return s$

endproc


>noexport NoExportIf a UnitProzedur or UnitFunktion not automatically of XPSE into .def File written go should - then is simply the Schlüsselwort "noexport" - with Freizeichen separated - behind whom names the procedure/function To write.
'example:

proc ?_sid noexport

    declare s$,o%
    o%:=get("Decimals")
    set("Decimals",0)
    s$:=(date$(3)+del$(time$(0),3,1)+del$(time$(1),3,1)+st$(&gettickcount))
    set("Decimals",o%)
    return s$

endproc

The function is so as "nicht-öffentlich" marked and ought to then too only inside the Unit uses go.

>for <i>For-Schleifen</i>XPSE supported For-creep to Pascal-Syntax.
'Examples:
cls
For i%=1 to 100 do begin;print i%;end
waitkey
end
'
cls
For i%=1 to 100 do begin

if i%=50

    print "Hälfte"

endif

end
waitkey
end
'
cls
For y%=1 to 100 do begin
For x%=1 to 100 do begin
setpixel x%,y%,0
end
print "Zeile:",y%
end
waitkey
end
'
cls
For i%=1 to 100 do begin

Repeat

    print o%
    o%++

until o%>100

end
waitkey
end

circa downward To count, is as well as To expect the "downto" instead of "to" To use.

too the optionale "Step"-Parameter becomes supported around the Schrittweite self To to determine.

or downward:

>asmstart <i>InlineAssembler</i>where "vorkompiliert" becomes, can also slight Plugins for Vorkompiler manufactured go. These chance ergriff Frank Abbing (https://frabbing.de  ) and set the first XPSE-PlugIn XPIA  since, and later whom XPRR .XPIA standing for XProfanInlineAssembler.

XPIA power it possible the inside the XProfanprogrammes Procedures/functions in [High-Level]-Assembler written go can. inside the XProfanprogrammes can the Result the Assemblerfunktionen without Problems zugegriffen go. The principle functions so: XPSE machine whom View source How dwelt - respect however on Assemblerpassagen which with ASMSTART eingeleitet, and ASMEND exits go. there's too ASMINCLUDE . it can as much as you want Assemblerpassagen in the XProfanquelltext vorkommen. to the Compile - and with existence of Assemblerpassagen in the View source - becomes XPIA with the To bearbeitenden View source launched. XPIA eruiert and part each Assemblerpassagen and created ASM-projects The against through XPIA on a Assemblerkompiler so relayed go, that the Assemblerkompiler a suitable DLL the native-kompilierten Assemblercode prepares. subsequently writes XPIA whom XProfanquelltext so around the on place the Assemblerpassagen The DLL-Aufrufe come off. The begot DLL becomes subsequently of XPIA in a XProfan-View source konvertiert - which The DLL During low the Laufzeit entpackt - so that these not included go must! it remaining means thereby the solely The Program-Exe included go must. the Assembler becomes complete into EXE verpackt. The into View source konvertierten DLL are too yet so small - thats whom View source not aufblähen. I.d.R is the DLL grade time 8192 byte big! the Inlineassember for XProfan was so born. :)

<i>INC and DEC</i>Variablenwert raise and to diminish. Einfache Syntax to Variablenin- and dekremierung - again angelehnt on The C++ / PHP Syntax. Through the suffix ++ can a variable circa 1 increased go, with the suffix -- verringert.
'example:
declare i%
i%++
//or
i%--

These Variante becomes z.B. in i%=i%+1 transformed, there's however lt. the Profanhilfe too faster functions, circa a variable To raise or To to diminish. meant is so "INC" and "DEC". For this bid XPSE a yet komfortablere Variante:
'example:
declare i%
i%+
//or
i%-

but not "DoppelPlus" or "Doppelminus" simply one simple "Plus" or "Minus", and already becomes the code not i%=i%+1, separate in inc i% konvertiert. there's well nothing Einfacheres as i%+ To write, circa i% circa 1 To raise!

<i>Experimentell/Fun: with Longs can also without indicated the Variablensuffixes so worked go. becomes no Variablensuffix indicated, so takes XPSE on its one Long. who means z.B. one Long namens cnt& Inkremieren would like need only cnt+ or cnt++ write. where here counts: cnt+ is faster as cnt++</i>

<i>Remarks/Rems</i>particularly for Programmer, which not solely in XProfan program, these two additional Remark-mutants one Willkommensgeschenk. These both Remvarianten are under Anderem from C++ and PHP famous. It can // or /* Text */ used go.

the Comment one whole Blockes through /* Text */ is means with XPSE possible and The IDE XProfEd  supported this. accordingly can whole Textpassagen simply and quick ausgeklammert go.
'example:
....row1
/*....row2
....row3
....row4 */
....row5

it can also within of/ one row geRemarkt go.
print "Hallo Welt",/*here rem*/&gettickcount
'comment through //
print "Hallo Welt"//here the comment, which at Zeilenende end

<i>Repeat/Until</i>XPSE ermöglichte fußgesteuerte Repeat-Until creep. To XProfan8 were such creep only with XPSE possible. In XProfan9 has Roland the Repeat- Until solid integrate. into seither nachfolgenden versions the XPSE becomes the Repeat-Until means not any more through XPSE umgesetzt go, there this now not any more necessary is and Rolands Variante by the Festeinbau zügiger is.

>swap SwapSwap swaps whom Content zweier variables equal Type.
'example:
declare a&,b&
a&=10
b&=20
swap a&,b&
print a&
print b&
waitkey
end

gives the following from:
20
10


<i>Zuweisungs/Vergleichsoperatoren</i>C++ / Delphi & PHP'er are it z.B. dwelt in the Contrast To Basicprogrammierern for the "Zuweisen of Variablen" and the "Vergleichen of Variablen" a different Syntax To use. these schlichtweg übersichtlicher and helps with the genaueren Interpretierung by the Humans. In Basic - so too in XProfan - is the Gleichheitszeichen one Zuweisungs- <b>und</b> Vergleichoperator. at that Reading XProfan-code by a not- XProfan-Programmer can here flimsy Mißverständnisse come into being.

It can naturally too furthermore "Zugewiesen" and "Verglichen" go How dwelt. XPSE schränkt not one - separate should "Erweitern". XPSE bid for XProfan now at least The augenscheinliche Possibility between Zuweisungs- and Vergleichsoperator To discern.

operationXProfanC + +/PHPDelphiXProfan with XPSE
Wertzuweisung==:=<i>alle these Varianten</i>
comparison====<i>alle these Varianten</i>

'example:

if (a%==b%)

    a%:=b%*4

endif


<i>Funktionen</i>The "alten" Createfunktionen stay receive! The "alten" Createfunktionen stay dank automatischer conversion into "neue" Createsyntax receive and go even extended.

<b>Folgende Funktionsnamen can simply weiterverwendet go:</b>
· CREATETEXT
· CREATEDIALOG
· CREATECHOICEBOX
· CREATELISTBOX
· CREATESORTEDLISTBOX
· CREATETABCONTROL
· CREATEWINDOW
· CREATEGROUPBOX
· CREATEEDIT
· CREATEMULTIEDIT
· CREATEBUTTON
· CREATEDEFBUTTON
· CREATEDATEEDIT
· CREATETIMEEDIT
· CREATESPINEDIT
· CREATEPICBUTTON
· CREATEICONBUTTON
· CREATEHTMLBOX
· CREATETOOLWINDOW
· CREATELEFTBUTTON
· CREATECENTERTEXT
· CREATERIGHTTEXT
· CREATESUNKENTEXT
· CREATESUNKENCENTERTEXT
· CREATESUNKENRIGHTTEXT
· CREATESTATIC
· CREATEBLACKFRAME
· CREATEBLACKRECT
· CREATEHTMLBOX

the Control HTMLBOX is a Control from the ATL.DLL. it'll hierbei the IE as Anzeigemodul used. CreateHtmlBox can very How z.B. Createtext without Umwege prepares go. The as 2. Parameter übergebene Text can either a "URL" his, or one direct html beginnend with "mshtml:". These function is z.B. interestingly for simple About-boxing or Help Files. I could in my try at least 32k Html directly by MSHTML: transfer - and the Content watts always correctly displayed. If a local HTML-File showing should, then is the "file:///c:/ordner/htmldatei.html"-stature To benefit. the Control is too inspired To benefit circa z.B. Bilddateien view - there the IE almost each stature present can.
'example:
declare h&
cls
h&=createhtmlbox(%Hwnd,
"mshtml:<html><head></head><body><h1>Info</h1>Testinfo</body></html>"
,0,0,320,240)
waitinput
destroywindow(h&)
end


for the Parameter is too simply The "alte" Form benefit, because XPSE setting these entire circa:
declare h&
cls
h&=createtext(%Hwnd,"Text",0,0,320,240)
waitinput
destroywindow(h&)
end

>oop <i>OOP</i>too for OOP-inspired XProfan bid XPSE here and there a couple experimentelle Features. to that a whom Operator :: and to that others the Schlüsselwort this->. but too The Possibility the Weglassens the Suffixes for Memory-Variable which The class aufnimmt is very interestingly!

circa it short To grasp here to that a the "normale", and to that others a Possibility The with XPSE used go <u>kann</u>.
'the normal:
class dog = dog@, bark@, bellAnzahl&

proc dog.dog

    .bellAnzahl&=0
    Print "Hund initialisiert"
    dog.bark()

endproc

proc dog.bark

    .bellAnzahl&=.bellAnzahl&+1
    print "Bell:",.bellAnzahl&

endproc

var myHund#=new(dog)
myHund#.bark()
waitkey
dispose myHund#
end

'with the XPSE possible:
class dog = dog@, bark@, bellAnzahl&

proc dog.dog

    .bellAnzahl&:=0
    Print "Hund initialisiert"
    this->bark()

endproc

proc dog.bark

    .bellAnzahl&:=.bellAnzahl&+1
    print "Bell:",.bellAnzahl&

endproc

var myHund:=new(dog)'no Rautezeichen!
myHund::bark()'no #. Fingerbrecher necessary :D
waitkey
dispose myHund'no # necessary
end
Innherhalb of classes can means on modes the equal class with this-> zugegriffen go (erspart the wiederholte type the Klassenbezeichnung) and ausserhalb of classes can on modes through :: zugegriffen go. with the usage of new  and :: and dispose  can on The indicated the Rautezeichens for Memory-Variable waived go. (except Arrays of Memory-Variables) in the general Use with XProfanOOP has this as very useful erwiesen!

>include IncludeInkludiert Quelltextdateien, Header-Files or Units. according to Endung the File tappt im dunkeln properly eingebunden.

becomes "#include" instead of "include" written fit XPSE hereon the The Include too only one time eingebunden becomes - alike How often the appeal vorkommt. Similar How PHP's "include_once".

circa a Include-File einzubinden becomes in XProfan the Compilerschalter "$I" using. XPSE'ler can but too Include or #include write - the behaviour remaining same. particularly with Includes increased XPSE whom comfort. its now z.B. possible, simply The File extension wegzulassen - it'll automatically to inc and prf sought. likewise, if XPSE The Include not own directory finds, becomes these Order used, around the place the Include to ascertain:

· /.inc
· /include
· /includes
· /include/.inc
· /includes/.inc
· /.prf
· /include/.prf
· /includes/.prf

one need means only yet '#include myinc' write, even if the Inc or Prf not same directory, separate in a the named Unterordner befindet.

it go too The in the ProfanEditor angegebenen Includepfade berücksichtig. Related Compilerschalter:{$Includepath  ...}


Inkludiert The Quelltextdatei "meine.inc".

Inkludiert the HeaderFile "windows.ph".

Inkludiert The Unit "lists.pcu" with the Namensraumsymbol "lst.".

>const ConstConst is a very mächtiges tool the XPSE. with Const go Konstanten or whole Syntaxblöcke definiert. The usage this Konstanten instead of the Def -Konstanten recommend I there these not to Laufzeit, separate at Compile umgesetzt go - what a Geschwindigkeitsvorteil means, and there these Konstanten no nuisance PreFix carry must.


 
05/30/07  
 



Note / Question or Comment to the Help--Topic


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.217 Views

Untitledvor 0 min.
Christof Neuß09/10/18
Andreas Koch01/14/13
Mirko01/28/12
Peter Max Müller12/13/11
More...

Themeninformationen

this Topic has 1 subscriber:

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