More Hello World

 

.* Funny Hello World Example.

Core:
Parent None.* This Thing inherits nothing.
Space [Hello World].* Binding to other Things.

Thing->Execution->Level->Encrypt=[IEEE6020].* Set compiling options.

 

Role:
Main Thing.* Nominates this Ting as entry Thing, thrue the name space Hello World it doesen't matter witch file started.

 


Rules:
Be Strict.* Ensure, you write proper code.
No Critical.* This Thing is not designed to run in sensitive areas.
Stand Alone.* That's a level of access.
.*End Keep Session.* Memory resistent (This do not include crashs).
.*Sigleton.* Make this Thing system wide unique.
Thing->Security->Cert->Check->{Url:\https://www.microsoft.com/certifications?appid=562507531931388} With @=New Cert->Body->{Sec:\cert2022.0pl}.* Certifys a file in a secure area of the mainboard by the IDE (Only available on win11 ready machines)..

* This step is to ensure you are manufacturer and accept it from the scratch. The Software will start anyway.
If:(ShowSplashScreen=Yes).* Can toggle.
    Show SplashScreen->{Thing:\startscreen.0pl}.* Thing SplashScreen is called from the FancySys library.
End:(If)
Running With High Priority.* Change the setting in MS Win TaskManager or LoadBalanceSys.
Thing->Security->Check->Sum.* Prevents Injections anyway. Avoid it, if you want
to change mnemonics by code (Not reconomendet if not realy needed).

If:(DarkMode)
    Use Theme->{Thing:\dark.0pl}.*
Else:
    Use Theme->{Thing:\bright.0pl}.*
End:(If)
@=New Thread->{Thing:\threading.0pl}, Actor=[BackGroundThing], Sync=No, Start.* Set the thread in action.
Load Scene Start.* Start Entrypoint of the programm.


Librarys:
Load WinSys.* Load all stuff to display standard windows.
Load FancySys.* Load Things like SplashScreen etc...
Load GameSys.
* Layers, Sprites etc...
Import->{Sys:\fancy.dll}, Name=[Fancy], Manager=Auto.* Imports a strange library.
Import->{Sys:\phyton.py}, Name=[Wham], Manager=.* It's simple to invoke other lang's.

 

Thing:(Abstract)
      .** Abstract is created from scratch because of the omnipresent @ sign, this make your Thing and put it to use, a little machine that knows what to do and wants to be cloned, abused and raped so often, a bot.
      @=New BluePrint->Name=[Ridigiuos], DerivedFrom->{Thing:\class.0pl} Stay.*
End:


 

Symbols:
Console=New Console.* Turn the Software into a tool with no firlefanz.
Canvas=New Layer FullSize.* Draw grownd for every purpose.
Main=New Window Size=555px,333px Position=Auto Text=mainTitle
Topmost=True.* Create main window thrue missing owner.
MainLabel=New Label Owner=Main Size=Measure(Text),Measure(Text)
Position=Center,Center(Text) Text=a+c+b Style=Freaky Topmost=0.* This
Thing is to bring a Text on the Screen.

BtnSave=New Button Owner=Main Size=Measure(Text),Measure(Text)
Position=Center,Center(Text)+150px Text=[Click me]
Style=Freaky Topmost=1.* BtnSave Thing.

BtnGet=New Button Owner=Main Size=Measure(Text),Measure(Text)
Position=Center,Center(Text)+180px Text=[Show Data]
Style=Freaky Topmost=1.* BtnGet Thing.
PickUp=New Window->{Thing:\pickup.0pl} Owner=Main Size=333px,222px Position=Auto
Text=mainTitle Topmost=True.* Create a window.
InputValues Window->{Thing:\input.0pl} Owner=Main Size=333px,222px Position=Auto
Text=mainTitle Topmost=True.* Create a window.
GagMain=New Scene->{Thing:\confuse.0pl}.* Starts to make the user stupid until it's enough.


Var:(Root, Global, Constant)
.* Every Var: section out of a section must be root to qualify the variable in locals.
mainTitle=[Hello World in 0pl].* Title of the Main window.
tableName=[PERSONAL].*
Ball=New Sprite->{Thing:\ball.png}, Position=100px,100px Layer=Canvas.* Some play Thing.



Var:(Root, Private, SaveType)
.* Keep in mind, that Things never can be SaveType.
boolean=True.* Boolean.
stopBeepCounter=0.* TinyInt.
a=[Hello].* String.
b=[World].*
c=[\nl\print\screen].*
d=[[cDc]&[\sp]&[b0g!#@!]&[\sp]]&[Open Fire Technology]].*Some string like [4Chan->ANON<>EVIL]
e=42.* Integer.
f=0.0.* Floating Point.
g=5€.* Courrency.
h=New Operator->{Thing:\definition.0pl}.* This type may not defined without SaveType.


Var:(Root, Private, Constant)
string=[I am the king of Badlands].* Unsave type.
Timer=New Timer Intervall=10s Start.* Creates the condition that
something has to be executed continously.



Var:(Root, Friends)
Freaky=New Style Font=Tombraider,18px Color=55,142,69,0.*

Dictionary=New Dict->{Thing:\dict.0pl}.* Define what cols needed.


Grafic:(TV)
Format 4k.* Supported are 8k, 4k, FullHD, HD, VGA, Auto.


Grafic:(Laptop,Phone)
Format HD.* This depence on if supported.


Printer:(All)
Color Black Only.* Saves ink if user able to design RTF.


Container:(Hardware->Memsys)
.** This avoids usage of the Registry or Settings or other initalisation
files.
    ShowSplashScreen=Yes.* This value can be changed by code.
    DarkMode=No.* This value can be changed by code.
    Mnemonics=New Inline <    
         SUBXMP   CEEENTRY PPA=XMPPPA,AUTO=WORKSIZE
         USING WORKAREA,R13
* Invoke CEEMOUT to issue the greeting message
         CALL  CEEMOUT,(HELLOMSG,DEST,FBCODE),VL,MF=(E,CALLMOUT)
* No plist to DISPARM, so zero R1. Then call it.
         SLR   R0,R0
         ST    R0,COUNTER
         LA    R0,HELLOMSG
         SR    R01,R01 ssue a message
         CALL  DISPARM                CALL1
* Invoke CEEMOUT to issue the farewell message
         CALL  CEEMOUT,(BYEMSG,DEST,FBCODE),VL,MF=(E,CALLMOUT)
* Terminate Language Environment and return to the caller
         CEETERM  RC=0

*        CONSTANTS
HELLOMSG DC    Y(HELLOEND-HELLOSTR)
HELLOSTR DC    C'Hello from the sub example.'
HELLOEND EQU   *

BYEMSG   DC    Y(BYEEND-BYESTART)
BYESTART DC    C'Terminating the sub example.'
BYEEND   EQU   *
DEST     DC    F'2'               Destination is the LE message file
COUNTER  DC    F'-1'

XMPPPA   CEEPPA  ,                Constants describing the code block
*        The Workarea and DSA
WORKAREA DSECT
         ORG   *+CEEDSASZ         Leave space for the DSA fixed part
CALLMOUT CALL  ,(,,),VL,MF=L      3-argument parameter list
FBCODE   DS    3F                 Space for a 12-byte feedback code
         DS    0D
WORKSIZE EQU   *-WORKAREA
         PRINT NOGEN
         CEEDSA  ,                Mapping of the dynamic save area
         CEECAA  ,                Mapping of the common anchor area
R0       EQU   0
R01      EQU   1
R13      EQU   13
         END   SUBXMP             Nominate SUBXMP as the entry point
         >.* Inline Assembler cannot changed by code in this Thing.
End:


Container:(Universal)
Thing->Icon=New Base64
<
ICABIAYgICAgIAEgICDDkUAgIGYgICDigqzigqwgIAEgICAoCAEgN0EgIEBAICABICAgKEIgIF9JASAwMCAgASAgIMKoJSAg4oCh4o
C5ASAgICAgASAgIMKoECAgL8KxASAQECAgASAgIGgEICDDl8OBASDigLBQTkcNChoNCiAgIA0KSUhEUiAgASAgIAEgCAYgICBc
csKoZiAgIAFvck5UAcOPwqJ3xaEgIEDigLlJREFUeMOaw63Cv==
>.* The icon that is displayed in FileViewer.
End:


Connections:
    DataBase=New Con Type=MSADB, Server=[2023:0db8:85a3:08d3:0370:7242], User=[user],
    Pass=New Hash->{Sec:\pw.0pl}.* Connect to a database.
    DataBase->Save=SaveToDB.* Define the usage of save.
   
SimpleFile=New File->{Thing:\file.txt} Write Append.* Only in Stand Alone mode.
End:

 



Scene:(SaveToDB)
    If:(Selected->PickUp->Show(Index))
        DataBase->Update Table(tableName) On [ID]=Index.* Put values into existing dataset.
    Else:(Selected->PickUp->New)
        DataBase->Insert Table(tableName).* Create a new dataset.

    Else:
        Alert [You need to specify where you want the data saved.].* If user klicks X.
    End:(If)
End:

 

 

Scene:(GetFromDB)
    @=New FetchWin->DataBase->{Thing:\sql.0pl}.* Fetch Data from Thing DataBase.
     .* The @ sign is to create a Thing, once used and forget.

End:



Scene:(Start)
    Show Behind Canvas.* Set the background to visibility.
    If:(SplashScreen->Returns->Maybe).* The user has the ability to say
start maybe.
        Show GagMain.* Why are you this stupid child.
    Else:(SplashScreen->Returns->Yes).* User klicks OK.
        Show Main.* Display main form you define elsewhere, even in HTML.
    Else:(SplashScreen->Returns->No).* User klicks NO.
        Exit:(All).* The only way to close the programm properly.
    Else:(SplashScreen->Returns->Cancel).* User klicks CANCEL.
        If:(Show Message([Are you sure to cancel the greeting screen?]) = Yes).* Users joyce.
        Thing->ShowSplashScreen=No.* Next time the splash screen
        will be supressed.

        Show Main.*

    Else:
        Show Main.* Shows the Main Thing.

        Run Mnemonics.* If no SplashScreen appears run this peace of CPU food.
    End:(If)
End:

 

Scene:(ArraySort)
      @=New Array->{Thing:\array.0pl}->Sort(Desc)->Output=Console.* Improve sorting.
End:


Scene:(Calculator)
    Speak Calculate(get3Params), Lang=EnUS, Voice-
>{Thing:\voice.0pl}.* Tell the user the result.
End:



Cond:(BtnRepeat->Click)
.** Repeat.
    Repeat:(0,10, Sync=No)
        Canvas->Background->Color(Spectrum->{Thing:\bg.0pl}) Use Counter.* Repeats a Thing.
    End:(Repeat)
    
    Repeat:(Sync=No)
        Ball->Move->{Thing:\ball.0pl}.* Moves a sprite against extern roules.
    End:(Repeat Until Ball->Dissapear)

    Repeat:(Rand->Next, Sync=No Time=5s
         @=New Static Sprite Avatar->{Thing:\Avatar.0pl} Location 50px,50px Canvas=Canvas.*Create an avatar.
         @->Move->Pos=Right Walk->Left.* Let the spawned sprites go arround.

         .* If out of screen, you don't longer think on it, if away infinite then destroyed automaticaly.
    End:(Repeat)

    Repeat:(While e<=0, Time=10s, Sync=Yes)
        e--.* Decrements the value of 42 to Zero.

        @=New Text Write(e->ToString) Style=Freaky, Color=Yellow Effect->{Thing:\texteffect.0pl} Layer=Canvas, Center Destroy After 2s.*Displays the countdown.
    End:(Repeat)

End:
 

Cond:(Ball->Collision->Hunter([ShotBullet]))
.** Some Thing hit's the sprite Ball.
    
Run At Location(Ball)->{Thing:\explosion.0pl} Sync=No.* Set an explosion in action.
     Destroy Ball.* Get rid of the Ball. This stops the repeat loop.
End:

Thing:
(Name=[Hunter], Pos=MouseX Delay=0.2s Layer=Canvas)
.** You are the Hunter.
    
@=New Shape->{Thing:\ship.0pl}.* Let your Spaceship spawn.
     Input:
(Keys)
        If:(Key=Fire)
             ShotBullet=New Sprite->{Thing:\bullet.0pl}.* Fires a bullet sprite with a virtual gun.
        End:(If)

     End:
End:

 



Cond:(Timer->Tick)
.** After 3 times.
    @=New Sound->{Thing:\beep.mp3}.* Plays a file or a Command like Beep,
    Ring, Clack, Click, Bumm etc.

    If:(stopBeepCounter < 3)
        stopBeepCounter++.*
    Else:
        Timer->Stop.* You need to stop the timer here.
        Destroy Timer.* Get rid of the annoying sound every 10 seconds.
    End:(If)
End:


Cond:
(Database->Trigger->[RFID_Scan])
.** If database stored procedure triggers.
     @=New RFID->Scanner->GetId->Put Var:(Thing) [EmploeeUser].* Makes automatisation easy.
End:


Cond:(BtnSave->Click)
.** Let the user input a date and if properly save in databases or files.
    If:(EmploeeUser Is Null)
         Alert [Please identify your ID Card].* You need to scan your Chip.
         Exit:(Cond)

    End:(If)
    string=TryConv(TextIn([Type in your date of birth.],Line,Freaky) To
    Date Or Error).* Changes the type of the var „string" into a date type.
    If:(Error)
        BtnSave->GhostClick.* Repeat this.
    Else:
        DataBase->Save(string)->Target=[EmploeeUser],[DateOfBirth]->Use(Selected).*
    End:(If)
End:

 

Cond:(BtnGet->Click)
.** Shows a form to display data.
     Show->GetFromDB.*
End:



Funct:(Name=[get3Params]; Return=Thing)
    Ret Show->InputValues.* Calculate input.
End:


Funct:(Name=[Selected]; Return=Void)
    DataBase->PickOne.* Force user selection with lookup.
End:


Funct:(Name=[Calculate] NoRefParam=NumberOne As NumThing(Float),
NumberTwo As NumThing(Float, Not Zero), Operator As Thing,
Return=String Sync=No)
.** This function calculates two numbers with an operator.
    Select:(Operator)
        Case:([+])
            Ret ToText(NumberOne+NumberTwo).* Addition
        Case:([-])
            Ret ToText(NumberOne-NumberTwo).* Subtraction
        Case:([*])
            Ret ToText(NumberOne*NumberTwo).* Multiplication
        Case:([/])
            Ret ToText(NumberOne/NumberTwo).* Division
        Case:([%])
            Ret ToText(NumberOne%NumberTwo).* Modulo
        Else:
            Ret [Unknown operator], Error.* Caller get feedback.
    End:(Select)
End:

 

EOF