Supernova Programming Language

"The Supernova programming language is a modern scripting language that presents the concept of programming with direct Fiction Description using a clear subset of pure Human Language."

📖

Fiction Description

Programming with direct fiction description using subset of pure human language.

📝

Paragraph-Based

Programs are one or more paragraphs — collections of statements.

Writing Flexibility

Not Case, Tab, Space, or Line Sensitive.

🌎

Multi-Language

Source code in Arabic, English & Mixed.

Event-Driven

Instructions execution model is Event-Driven.

🔧

Hybrid VM

Hybrid Implementation — Compiler & Virtual Machine.

Hello World Program

This is the simplest Supernova program — the classic "Hello World" example. It creates a window and sets its title to "Hello World" using natural language syntax. Notice how the statement reads like plain English: you simply tell the language what you want, and it creates it for you.

HelloWorld.nova
I want window and the window title is Hello World.

Using the Interpreter

To use the Supernova interpreter, follow these steps:

Step 1: Create a new text file with the .nova extension.

Step 2: Write your Supernova source code in this file.

Step 3: Run nova.exe — the Supernova interpreter.

Step 4: Select your .nova file to execute it.

The interpreter will compile and execute your program, displaying the GUI windows and controls you described in your code.

When you run a .nova file, the interpreter generates an object file (YourFile.nova.star) which can be used for distribution.

Message from Supernova Creator

My name is Mahmoud Fayed and I live in Egypt.

I am the Creator of Supernova programming language and I am interested in Compiler implementation using AI Techniques. Supernova is a result of my researches in this topic.

Supernova is a language that tends to be more near to our human language where we do Programming With Fiction Description (PWFD) using a subset of pure human language.

The human language is VERY big and contains many words so we use a subset of it to Reduce the Complexity of the problem and to Get Acceptable Performance as much as we can.

Unlike other programming languages which are based on statements, Supernova is based on Paragraphs which contain many statements packed together using ignored words like (the, and, ...etc).

For example the two commands:
(1) I want window
(2) Window title is hello.
May be connected together to form another big statement:
I want window and the window title is hello.
And a collection of big statements form a paragraph. And a collection of paragraphs form a program.

Unlike other programming languages, most of Supernova statements have a rule that describes their structure and helps users remember them.

Rule: PVC

[P] = Pronoun   [V] = Verb   [C] = Class

Statement = I Want Window follows PVC Rule

[I] = Pronoun, [Want] = Verb, [Window] = Class — Easy to remember!

Rule: CAVD

[C] = Class   [A] = Attribute   [V] = Verb   [D] = Data

Statement = Window Title is ...data... follows CAVD Rule

[Window] = Class, [Title] = Attribute, [Is] = Verb, [..Data..] = Data — Easy to remember!

Supernova supports multi-language source code.

Many other subsets of human languages can be added in the future to help peoples from different countries and cultures learn computer programming.

Context-Sensitive Grammar

Unlike other programming languages which use Context-Free Grammar, Supernova uses a Context-Sensitive Grammar to get a language more near to our human language.

Example: I want window and the window title is I want window.

The first "I want window" is a command but the second "I want window" is data.

Supernova uses AI to understand what you want to write using the language grammar. It is not important if you write using UPPER case or lower case, also you can use spaces between words and/or between the same word letters and it does not matter if two statements are in the same line or not.

Distributing Applications as Executable Files

This feature is required to:

Get High performance (No compiling time)

Protect your source code

Distribute an easy to use software

Practical Steps

1. Run the application (YourFileName.nova) to get a generated object file (YourFileName.nova.star)

2. Create a new folder (Myapp as example)

3. Copy the generated object file YourFileName.nova.Star to this new folder (Myapp)

4. Copy nova.exe to this new folder (Myapp)

5. Rename YourFileName.nova.Star to YourApplicationName.Star

6. Rename nova.exe to YourApplicationName.exe

7. Distribute this new folder to your Customers/Friends

8. What they need is to Run YourApplicationName.exe

9. That is all, Have Fun!!

The idea is simple: when you run nova.exe after renaming it to YourApplicationName.exe, the interpreter will find a file named YourApplicationName.star to load and execute.

Example

1. Run Samples\DateAndTime\Flash.nova

2. Create new folder then copy Flash.nova.star & Nova.exe to this folder

3. Rename Flash.nova.star to Flash.star

4. Rename NOVA.exe to Flash.exe

5. Run Flash.exe (No Loading message appears, Have Fun!!)

Using Notepad++ to Write Supernova Source Code

You can use Notepad++ to write Supernova programs with syntax highlighting.

Installation Steps

1. Download Notepad++

2. Run Notepad++ Installer:

2.1 — Select a language (English for example)

2.2 — Click Next to continue

2.3 — Click "I Agree" button

2.4 — Determine Destination Folder then Click Next

***Important Step***

2.5 — Enable the option (Don't use %APPDATA%)

2.6 — Click Install

2.7 — Click Finish

3. Put the file userDefineLang.XML in the folder Program Files\Notepad++

Have Fun!!

Fiction Description

Fiction Description is the core programming paradigm of Supernova. It answers five fundamental questions:

[1] What do you want? (I Want ....)

I want window  |  I want listbox  |  I want Counter

[2] What do you remember? (The ...)

I want window contains label  /  The window title is Hello.  /  The label caption is Wow.

[3] What are the instructions? (... instructions are)

Manager. instructions must done / Manager. instructions are ... End of instructions

[4] What will happen when ...? (Object Event. instructions are)

win1 mouseclick. instructions are ... end of instructions

[5] What will happen if ...? (Variable Value. instructions are)

x 1. instructions are ... end of instructions

Fiction Description Samples

Fiction

Description

[1] What do

you want ? (I Want ....)

**Example**

I want window

I want listbox

I want Counter

[2] What do

you remember ? (The ...)

**Example**

I want window contains label

The window title is Hello.

The label caption is Wow.

[3] What are

the instructions ? (... instructions are)

**Example**

Manager. instructions must done

Manager. instructions are

I want window

Window title = wow.

End of instructions

[4] What

will happen when ... ? (Object Event. instructions are)

**Example**

I want window

The window name is win1.

win1 mouseclick. instructions are

You close window

end of instructions

[5] What

will happen if ... ? (Variable Value. instructions are)

**Example**

x 1. instructions are

i want window and window title = number 1.

end of instructions

x 2. instructions are

i want window and window title = number 2.

end of instructions

x 3. instructions are

i want window and window title = number 3.

end of instructions

[x]. = (1).

[x]. = (2).

[x]. = (3).

The following code block lists all the Fiction Description sample programs included with Supernova. These 16 samples cover a wide range of programming concepts — from basic event handling (ClickLoop, ShutDown) and user interaction (Question) to arithmetic (Math), Boolean logic (Logic), loops (Loops), dynamic GUI creation (DynamicObjects), conditional branching (Cases, CheckAnswer), and counter-based iteration (Counter, CounterRange).

code
---------------------------------
   Fiction Description Samples
---------------------------------
[1] ClickLoop
[2] ShutDown
[3] Question
[4] DownCounter
[5] UpCounter
[6] Counter
[7] Counter2
[8] Math
[9] Math2
[10] Logic
[11] Logic2
[12] CounterRange
[13] DynamicObjects
[14] Cases
[15] CheckAnswer
[16] Loops

This sample demonstrates interactive event chaining using mouse click events. It creates three windows in sequence: the first window, when clicked, spawns a second white window; clicking that creates a red window; and clicking the red window closes the entire application. This showcases Supernova's event-driven programming model where each object's mouse click event triggers new instructions.

ClickLoop.nova
Set window auto show off
 
I want window and the window name is mywin.
The window title is click me to get a new white window.
The window width is 350. and the window height is 200.
window top = 50.
You Show Window
 
mywin mouseclick. instructions are
        I want window and the window name is mywin2.
        window backcolor  = {255,255,255}. and window top = 100.
        The window title is click me to get a new red window.
        The window width is 350. and the window height is 200.
        You Show Window
End of instructions
 
mywin2 mouseclick. instructions are
        I want window and the window backcolor = {255,0,0}.
        window title = hello. and window top = 150.
        The window title is click me to close the application.
        The window name is mywin3.
        The window width is 350. and the window height is 200.
        You Show Window
End of instructions
 
mywin3 mouseclick. instructions are
        You close application
End of instructions

This sample builds a simple shutdown confirmation dialog. It creates a window with a "Close" button. When the user clicks Close, a confirmation prompt appears with "Yes" and "No" buttons. Clicking "Yes" closes the window, while clicking "No" changes the label text to "Great" — demonstrating dynamic GUI creation within event handlers and multi-level user interaction.

Shutdown.nova
i want window and the window title is Welcome.
 
i want button and button caption equal Close. 
the button top = 50. and button name = btn1.
 
btn1 mouseclick. instructions are 
        i want label and label caption = Really!!!.
        the label top = 100. 
        i want button and button caption = Yes.
        the button top = 150. and button name = btn2.
        i want button and button caption = No.
        the button top = 150. and button name = btn3.
        the button left = 150.
end of instructions
 
btn2 mouseclick. instructions are you close window ok
 
btn3 mouseclick. instructions are label caption is Great. ok

This sample creates a simple interactive form that asks the user for their name. It features a label prompt, a green-colored textbox for input, and two buttons: "Say Hello" and "Close". When the user enters their name and clicks "Say Hello", the window title updates to greet them by name. This demonstrates reading textbox values into variables and dynamically updating window properties.

Question.nova
I want window and the window title is Welcome.
Window width = 250. and window height = 350.
 
I want label and the label top = 50. and label width = 200. 
the label caption = What is your name ?.
 
I want textbox and textbox top = 100. 
textbox back color = {0,255,0}.
 
I want button and button caption equal Say Hello. 
The button top = 150. and button name = btn1. 
btn1 mouseclick. instructions are
        textbox value to [name]. 
        the window title from (Hello )[name].
end of instructions
 
I want button and button caption equal Close. 
the button top = 200. and button name = btn2. 
btn2 mouseclick. instructions are You Close window ok

This sample creates a down counter application with a textbox and two buttons. The user enters a starting number in the textbox, and each time the "Count" button is clicked, the displayed value decreases by 1. This demonstrates reading a textbox value into a variable, performing arithmetic subtraction, and writing the result back to the textbox.

DownCounter.nova
i want window and the window title is Down Counter.
Window width = 250. and window height = 250.
i want textbox and textbox top = 30. and textbox back color = {0,255,0}.
i want button and button caption equal Count. 
The button top = 70. and button name = btn1. 
btn1 mouseclick. instructions are
        textbox value to [num1]. and textbox value from [num1]-(1).
end of instructions
i want button and button caption equal Close. and the 
button top = 130. and button name = btn2. and the 
btn2 mouseclick. instructions are You Close window ok

This sample creates an up counter application — the counterpart to the down counter. Each click of the "Count" button increments the textbox value by 1. Together with the down counter, this demonstrates how Supernova handles basic arithmetic operations within event-driven button click handlers.

UpCounter.nova
i want window and the window title is Up Counter.
Window width = 250. and window height = 250.
i want textbox and textbox top = 30. and textbox back color = {0,255,0}.
i want button and button caption equal Count. 
The button top = 70. and button name = btn1. 
btn1 mouseclick. instructions are
        textbox value to [num1]. and textbox value from [num1]+(1).
end of instructions
i want button and button caption equal Close. and the
 button top = 130. and button name = btn2. and the
 btn2 mouseclick. instructions are You Close window ok
 

 
Application Files
-------------------
        1 - CounterApp.nova
        2 - UpCounter.nova
        3 - DownCounter.nova

This sample shows how to build a multi-file application in Supernova. The main file uses the "file instructions must done" command to include and execute code from separate source files (upcounter.nova and downcounter.nova), launching both the up counter and down counter windows simultaneously. This demonstrates Supernova's modular programming capability through file inclusion.

CounterApp.nova
"upcounter.nova" file instructions must done
"downcounter.nova" file instructions must done

This sample creates an up counter application — the counterpart to the down counter. Each click of the "Count" button increments the textbox value by 1. Together with the down counter, this demonstrates how Supernova handles basic arithmetic operations within event-driven button click handlers.

UpCounter.nova
i want window and the window title is Up Counter.
Window width = 250. and window height = 250.
i want textbox and textbox top = 30. and textbox back color = {0,255,0}.
the textbox name is up_text1.
i want button and button caption equal Count. 
The button top = 70. and button name = up_btn1. 
up_btn1 mouseclick. instructions are
        up_text1. textbox selected
        textbox value to [num1]. and textbox value from [num1]+(1).
end of instructions
i want button and button caption equal Close. and the button top = 130. and 
button name = up_btn2. and the up_btn2 mouseclick. instructions are You Close window ok

This sample creates a down counter application with a textbox and two buttons. The user enters a starting number in the textbox, and each time the "Count" button is clicked, the displayed value decreases by 1. This demonstrates reading a textbox value into a variable, performing arithmetic subtraction, and writing the result back to the textbox.

DownCounter.nova
i want window and the window title is Down Counter.
window left = 350.
Window width = 250. and window height = 250.
i want textbox and textbox top = 30. and textbox back color = {0,255,0}.
the textbox name is down_Text1.
i want button and button caption equal Count. 
The button top = 70. and button name = down_btn1. 
down_btn1 mouseclick. instructions are
        down_text1. textbox selected
        textbox value to [num1]. and textbox value from [num1]-(1).
end of instructions
i want button and button caption equal Close. and the button top = 130. and 
button name = down_btn2. and the down_btn2 mouseclick. instructions are You Close window ok

This is an enhanced version of the counter application that introduces a main window with a menu bar. The main window serves as a parent container with "File" menu options for "Up Counter", "Down Counter", and "Exit". Each menu item triggers its respective counter procedure on demand, and a status bar displays "Ready" at the bottom. This demonstrates menu-driven application architecture with parent-child window relationships.

Counterapp2.nova
"downcounter.nova" file instructions must done
"upcounter.nova" file instructions must done
 
The application title is "Counter (2)"
 
I want window 
The window title is "Counter2"
The window backcolor is {255,255,255}.
The window name is the main window.
 
I want menubar 
I want menu popup and menu popup caption is "File"
        I want menu item and the menu item caption is "Up Counter"
        The menu item name is myitem1.
        myitem1 mouseclick. instructions are
               myup. instructions must done
        End of instructions
        I want menu item and the menu item caption is "Down Counter"
        The menu item name is myitem2.
        myitem2 mouseclick. instructions are
               mydown. instructions must done
        End of instructions
        I want menu item and the menu item caption is "Exit"
        The menu item name is myitem3.
        myitem3 mouseclick. instructions are
               You close application
        End of instructions
 
 
I want statusbar and i want status item and the status item caption is Ready.
 
You maximize window

This sample creates an up counter application — the counterpart to the down counter. Each click of the "Count" button increments the textbox value by 1. Together with the down counter, this demonstrates how Supernova handles basic arithmetic operations within event-driven button click handlers.

UpCounter.nova
myup. instructions are
 
i want window and the window title is Up Counter.
Window width = 250. and window height = 250. and window top = 100.
The window parent is the main window.
 
i want textbox and textbox top = 30. and textbox back color = {0,255,0}.
the textbox name is up_text1.
 
i want button and button caption equal Count. 
The button top = 70. and button name = up_btn1. 
 
up_btn1 mouseclick. instructions are
        up_text1. textbox selected
        textbox value to [num1]. and textbox value from [num1]+(1).
end of instructions
 
i want button and button caption equal Close.
the button top = 130. and button name = up_btn2. 
the up_btn2 mouseclick. instructions are You Close window ok
 
ok

This sample creates a down counter application with a textbox and two buttons. The user enters a starting number in the textbox, and each time the "Count" button is clicked, the displayed value decreases by 1. This demonstrates reading a textbox value into a variable, performing arithmetic subtraction, and writing the result back to the textbox.

DownCounter.nova
mydown. instructions are
 
i want window and the window title is Down Counter.
window top = 100. and window left = 350.
Window width = 250. and window height = 250.
 
The window parent is the main window.
 
i want textbox and textbox top = 30. and textbox back color = {0,255,0}.
the textbox name is down_Text1.
 
i want button and button caption equal Count. 
The button top = 70. and button name = down_btn1. 
 
down_btn1 mouseclick. instructions are
        down_text1. textbox selected
        textbox value to [num1]. and textbox value from [num1]-(1).
end of instructions
 
i want button and button caption equal Close. 
the button top = 130. and button name = down_btn2. 
the down_btn2 mouseclick. instructions are You Close window ok
 
ok

This is the launcher file for the Math application suite. It includes four separate arithmetic operation files (sum, subtraction, multiplication, and division) using the file inclusion mechanism, causing all four calculator windows to appear simultaneously when the application runs.

MathApp.nova
"sumapp.nova" file instructions must done
"minapp.nova" file instructions must done
"mulapp.nova" file instructions must done
"divapp.nova" file instructions must done

This sample implements an addition calculator. It creates a window with two labeled textboxes for number input and a "do operation" button. When clicked, the button reads both values, computes their sum using the + operator, and displays the result in the window title. The "Set Window Auto Show Off" at the top gives the programmer control over when the window becomes visible.

SumApp.nova
Set Window Auto Show Off
 
I want window and the window title is Sum. 
Window top = 20. and window left = 50.
Window width = 250. and Window height = 250.
 
I want label and the label caption is Number (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Number (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = sum_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = sum_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = sum_btn1.
sum_btn1 mouseclick. instructions are
        sum_txt1. textbox selected and store textbox value to [num1].
        sum_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1]+[num2].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = Sum_btnClose.
sum_btnclose mouseclick. instructions are you close window ok
 
You Show Window

This sample implements a subtraction calculator with a distinctive red background. Like the sum application, it provides two textboxes for number input. When the user clicks "do operation", the program reads both values, subtracts the second from the first using the - operator, and displays the result in the window title.

MinApp.nova
set window auto show off
 
I want window and the window title is Min.
Window top = 20. and window left = 350.
Window width = 250. and Window height = 250.
Window backcolor = {255,0,0}.
 
I want label and the label caption is Number (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Number (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = min_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = min_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = min_btn1.
min_btn1 mouseclick. instructions are
        min_txt1. textbox selected and store textbox value to [num1].
        min_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1]-[num2].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = min_btnClose.
min_btnclose mouseclick. instructions are you close window ok
 
you show window

This sample implements a multiplication calculator with a green background. It follows the same pattern as the other math applications: two input textboxes, an operation button that reads values and computes the product using the x operator, and the result displayed in the window title.

MulApp.nova
set window auto show off
 
I want window and the window title is Mul. 
Window top = 300. and window left = 50.
Window width = 250. and Window height = 250.
Window Back Color = {0,255,0}.
 
I want label and the label caption is Number (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Number (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = mul_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = mul_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = mul_btn1.
mul_btn1 mouseclick. instructions are
        mul_txt1. textbox selected and store textbox value to [num1].
        mul_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1]x[num2].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = mul_btnClose.
mul_btnclose mouseclick. instructions are you close window ok
 
you show window

This sample implements a division calculator with a blue background. It completes the set of four basic arithmetic operations. The "do operation" button reads two numbers and divides the first by the second using the / operator, displaying the result in the window title.

DivApp.nova
Set Window Auto Show off
 
I want window and the window title is Div.
Window top = 300. and window left = 350.
Window width = 250. and Window height = 250.
Window Back Color = {0,0,255}.
 
I want label and the label caption is Number (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Number (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = div_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = div_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = btn1.
btn1 mouseclick. instructions are
        div_txt1. textbox selected and store textbox value to [num1].
        div_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1]/[num2].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = btnClose.
btnclose mouseclick. instructions are you close window ok
 
You Show Window
 

 
 

 
Application Files
-------------------
        1 - MathApp2.nova
        2 - SumApp.nova
        3 - MinApp.nova
        4 - MulApp.nova
        5 - DivApp.nova

This is the enhanced menu-driven version of the Math application. Instead of showing all four calculator windows at once, it creates a main window with a menu bar containing options for Sum (+), Min (-), Mul (x), Div (/), and Exit. Each calculator opens as a child window when selected from the menu, demonstrating a more professional, organized application structure with parent window management.

MathApp2.nova
"sumapp.nova" file instructions must done
"minapp.nova" file instructions must done
"mulapp.nova" file instructions must done
"divapp.nova" file instructions must done
 
The application title is "Math (2)"
 
I want window 
The window title is "Math2"
The window backcolor is {255,255,255}.
The window name is the main window.
 
I want menubar 
I want menu popup and menu popup caption is "File"
        I want menu item and the menu item caption is "Sum (+)"
        The menu item name is myitem1.
        myitem1 mouseclick. instructions are
               mysum. instructions must done
        End of instructions
        I want menu item and the menu item caption is "Min (-)"
        The menu item name is myitem2.
        myitem2 mouseclick. instructions are
               mymin. instructions must done
        End of instructions
        I want menu item and the menu item caption is "Mul (x)"
        The menu item name is myitem3.
        myitem3 mouseclick. instructions are
               mymul. instructions must done
        End of instructions
        I want menu item and the menu item caption is "Div (/)"
        The menu item name is myitem4.
        myitem4 mouseclick. instructions are
               mydiv. instructions must done
        End of instructions
        I want menu item and the menu item caption is "Exit"
        The menu item name is myitem5.
        myitem5 mouseclick. instructions are
               You close application
        End of instructions
 
 
I want statusbar and i want status item and the status item caption is Ready.
 
You maximize window

This sample implements an addition calculator. It creates a window with two labeled textboxes for number input and a "do operation" button. When clicked, the button reads both values, computes their sum using the + operator, and displays the result in the window title. The "Set Window Auto Show Off" at the top gives the programmer control over when the window becomes visible.

SumApp.nova
mysum. instructions are
 
Set Window Auto Show Off
 
I want window and the window title is Sum. 
Window top = 20. and window left = 50.
Window width = 250. and Window height = 250.
 
I want label and the label caption is Number (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Number (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = sum_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = sum_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = sum_btn1.
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = Sum_btnClose.
 
The window parent is the main window.
You Show Window
 
end of instructions
 
sum_btn1 mouseclick. instructions are
        sum_txt1. textbox selected and store textbox value to [num1].
        sum_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1]+[num2].
End of instructions
 
sum_btnclose mouseclick. instructions are you close window ok

This sample implements a subtraction calculator with a distinctive red background. Like the sum application, it provides two textboxes for number input. When the user clicks "do operation", the program reads both values, subtracts the second from the first using the - operator, and displays the result in the window title.

MinApp.nova
mymin. instructions are
 
set window auto show off
 
I want window and the window title is Min.
Window top = 20. and window left = 350.
Window width = 250. and Window height = 250.
Window backcolor = {255,0,0}.
 
I want label and the label caption is Number (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Number (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = min_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = min_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = min_btn1.
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = min_btnClose.
 
The window parent is the main window.
you show window
 
end of instructions
 
min_btn1 mouseclick. instructions are
        min_txt1. textbox selected and store textbox value to [num1].
        min_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1]-[num2].
End of instructions
 
min_btnclose mouseclick. instructions are you close window ok

This sample implements a multiplication calculator with a green background. It follows the same pattern as the other math applications: two input textboxes, an operation button that reads values and computes the product using the x operator, and the result displayed in the window title.

MulApp.nova
mymul. instructions are
 
set window auto show off
 
I want window and the window title is Mul. 
Window top = 300. and window left = 50.
Window width = 250. and Window height = 250.
Window Back Color = {0,255,0}.
 
I want label and the label caption is Number (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Number (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = mul_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = mul_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = mul_btn1.
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = mul_btnClose.
 
The window parent is the main window.
you show window
 
end of instructions
 
mul_btn1 mouseclick. instructions are
        mul_txt1. textbox selected and store textbox value to [num1].
        mul_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1]x[num2].
End of instructions
 
 
mul_btnclose mouseclick. instructions are you close window ok

This sample implements a division calculator with a blue background. It completes the set of four basic arithmetic operations. The "do operation" button reads two numbers and divides the first by the second using the / operator, displaying the result in the window title.

DivApp.nova
mydiv. instructions are
 
Set Window Auto Show off
 
I want window and the window title is Div.
Window top = 300. and window left = 350.
Window width = 250. and Window height = 250.
Window Back Color = {0,0,255}.
 
I want label and the label caption is Number (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Number (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = div_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = div_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = btn1.
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = btnClose.
 
The window parent is the main window.
You Show Window
 
end of instructions
 
btn1 mouseclick. instructions are
        div_txt1. textbox selected and store textbox value to [num1].
        div_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1]/[num2].
End of instructions
 
 
btnclose mouseclick. instructions are you close window ok
 
 

 
 
Application Files
-------------------
        
        1 - LogicApp.nova
        2 - AndApp.nova
        3 - OrApp.nova
        4 - NotApp.nova

This is the launcher file for the Logic application suite. It includes three separate files implementing the Boolean AND, OR, and NOT operations, launching all three logic calculator windows simultaneously.

LogicApp.nova
"andapp.nova" file instructions must done
"orapp.nova" file instructions must done
"notapp.nova" file instructions must done

This sample implements a Boolean AND operation calculator. It creates a window with two input textboxes for truth values and a "do operation" button. When clicked, it reads both values and computes their logical AND, displaying the result in the window title. This demonstrates Supernova's support for Boolean logic operations.

AndApp.nova
Set Window Auto Show Off
 
I want window and the window title is And. 
Window top = 20. and window left = 350.
Window width = 250. and Window height = 250.
 
I want label and the label caption is Value (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Value (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = log_and_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = log_and_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = log_and_btn1.
 
log_and_btn1 mouseclick. instructions are
        log_and_txt1. textbox selected and store textbox value to [num1].
        log_and_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1] and [num2].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = log_and_btnClose.
log_and_btnclose mouseclick. instructions are you close window ok
 
You Show Window

This sample implements a Boolean OR operation calculator. Similar to the AND calculator, it takes two input truth values and computes their logical OR when the operation button is clicked, displaying the result in the window title.

OrApp.nova
Set Window Auto Show Off
 
I want window and the window title is OR. 
Window top = 20. and window left = 50.
Window width = 250. and Window height = 250.
 
I want label and the label caption is Value (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Value (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = OR_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = OR_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = OR_btn1.
OR_btn1 mouseclick. instructions are
        OR_txt1. textbox selected and store textbox value to [num1].
        OR_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1] OR [num2].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = OR_btnClose.
OR_btnclose mouseclick. instructions are you close window ok
 
You Show Window

This sample implements a Boolean NOT operation calculator. Unlike AND and OR which take two inputs, NOT requires only a single input value. The "do operation" button reads the value and computes its logical negation, displaying the result in the window title.

NotApp.nova
Set Window Auto Show Off
 
I want window and the window title is Not. 
Window top = 300. and window left = 50.
Window width = 250. and Window height = 250.
 
I want label and the label caption is Value.
Label top = 50. and label width = 80.
 
I want textbox and the textbox name = Not_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = Not_btn1.
Not_btn1 mouseclick. instructions are
        Not_txt1. textbox selected and store textbox value to [num1].
        The window title from not [num1].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = Not_btnClose.
Not_btnclose mouseclick. instructions are you close window ok
 
You Show Window
 

 
 
Application Files
-------------------
 
        1 - LogicApp2.nova
        2 - AndApp.nova
        3 - OrApp.nova
        4 - NotApp.nova

This is the enhanced menu-driven version of the Logic application. It creates a main window with a menu bar offering And, Or, Not, and Exit options. Each logic calculator opens as a child window on demand, following the same menu-driven architecture as the Math2 application. A status bar provides user feedback.

LogicApp2.nova
"andapp.nova" file instructions must done
"orapp.nova" file instructions must done
"notapp.nova" file instructions must done
 
The application title is "Logic (2)"
 
I want window 
The window title is "Logic2"
The window backcolor is {255,255,255}.
The window name is the main window.
 
I want menubar 
I want menu popup and menu popup caption is "File"
        I want menu item and the menu item caption is "And"
        The menu item name is myitem1.
        myitem1 mouseclick. instructions are
               myand. instructions must done
        End of instructions
        I want menu item and the menu item caption is "Or"
        The menu item name is myitem2.
        myitem2 mouseclick. instructions are
               myor. instructions must done
        End of instructions
        I want menu item and the menu item caption is "Not"
        The menu item name is myitem3.
        myitem3 mouseclick. instructions are
               mynot. instructions must done
        End of instructions
 
        I want menu item and the menu item caption is "Exit"
        The menu item name is myitem4.
        myitem4 mouseclick. instructions are
               You close application
        End of instructions
 
 
I want statusbar and i want status item and the status item caption is Ready.

This sample implements a Boolean AND operation calculator. It creates a window with two input textboxes for truth values and a "do operation" button. When clicked, it reads both values and computes their logical AND, displaying the result in the window title. This demonstrates Supernova's support for Boolean logic operations.

AndApp.nova
myand. instructions are
 
Set Window Auto Show Off
 
I want window and the window title is And. 
Window top = 20. and window left = 350.
Window width = 250. and Window height = 250.
 
I want label and the label caption is Value (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Value (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = log_and_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = log_and_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = log_and_btn1.
 
log_and_btn1 mouseclick. instructions are
        log_and_txt1. textbox selected and store textbox value to [num1].
        log_and_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1] and [num2].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = log_and_btnClose.
log_and_btnclose mouseclick. instructions are you close window ok
 
The window parent is the main window.
You Show Window
 
end of instructions

This sample implements a Boolean OR operation calculator. Similar to the AND calculator, it takes two input truth values and computes their logical OR when the operation button is clicked, displaying the result in the window title.

OrApp.nova
myor. instructions are
 
Set Window Auto Show Off
 
I want window and the window title is OR. 
Window top = 20. and window left = 50.
Window width = 250. and Window height = 250.
 
I want label and the label caption is Value (1).
Label top = 50. and label width = 80.
 
I want label and the label caption is Value (2).
Label top = 100. and label width = 80.
 
I want textbox and the textbox name = OR_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want textbox and the textbox name = OR_txt2.
Textbox top = 100. and textbox left = 100.and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 150. and button name = OR_btn1.
OR_btn1 mouseclick. instructions are
        OR_txt1. textbox selected and store textbox value to [num1].
        OR_txt2. textbox selected and store textbox value to [num2].
        The window title from [num1] OR [num2].
End of instructions
 
 
I want button and button caption = Close.
Button top = 150. and button left = 130. and button name = OR_btnClose.
OR_btnclose mouseclick. instructions are you close window ok
 
The window parent is the main window.
You Show Window
 
end of instructions

This sample implements a Boolean NOT operation calculator. Unlike AND and OR which take two inputs, NOT requires only a single input value. The "do operation" button reads the value and computes its logical negation, displaying the result in the window title.

NotApp.nova
mynot. instructions are
 
Set Window Auto Show Off
 
I want window and the window title is Not. 
Window top = 270. and window left = 50.
Window width = 250. and Window height = 200.
 
I want label and the label caption is Value.
Label top = 50. and label width = 80.
 
I want textbox and the textbox name = Not_txt1.
Textbox top = 50. and textbox left = 100. and textbox width = 50.
 
I want button and button caption = do operation.
Button top = 100. and button name = Not_btn1.
Not_btn1 mouseclick. instructions are
        Not_txt1. textbox selected and store textbox value to [num1].
        The window title from not [num1].
End of instructions
 
 
I want button and button caption = Close.
Button top = 100. and button left = 130. and button name = Not_btnClose.
Not_btnclose mouseclick. instructions are you close window ok
 
The window parent is the main window.
You Show Window
 
end of instructions
 

 
Sample Files
--------------
 
        1 - CounterRange.nova
        2 - CounterRange2.nova

This sample demonstrates Supernova's counter object for range-based iteration. It creates a form where the user specifies "From" and "To" values, and clicking "Count Forward" creates a counter that iterates through the range with a step of 1. Each counter value is added to a listbox through the counter's change event. This shows how Supernova implements counting loops using its unique counter object paradigm.

CounterRange.nova
:note: "application settings"
set window auto show off
set label transparent on
The application title is "Counter Range"
 
:note: "application window"
I want window and the window title is "Counter Range"
window width = 370. and window height = 360.
the window back color = {255,255,255}.
 
:note: "window controls"
i want label and label caption is "From"
i want textbox and textbox left is 50. and the textbox name is text1.
the textbox value is 1.
i want label and label caption is "To" and the label top is 50.
i want textbox and textbox left is 50. and the textbox name is text2.
the textbox value is 10.
the textbox top is 50.
i want listbox and listbox top is 100.
i want button and button caption is "Count Forward"
the button top is 100. and the button left is 230.
the button name is btn1.
 
:note: "application task"
btn1 mouseclick. instructions are
        i want counter 
        text1. textbox selected and textbox value to [num1].
        text2. textbox selected and textbox value to [num2].
        get the counter start from [num1].
        get the counter end from [num2].
        the counter step is 1.
        the counter name is mycount1.
        you use counter 
        mycount1 change. instructions are
               counter value to [myvalue]. 
               listbox must add from [myvalue].
        end of instructions
end of instructions
 
You Show Window

This is the backward-counting version of the CounterRange sample. The "From" value defaults to 10 and "To" defaults to 1, with the counter step set to -1. When the "Count backward" button is clicked, the counter decrements from the start value down to the end value, adding each value to the listbox. This demonstrates that Supernova's counter objects support both ascending and descending iteration.

CounterRange2.nova
:note: "application settings"
set window auto show off
set label transparent on
The application title is "Counter Range 2"
 
:note: "application window"
I want window and the window title is "Counter Range"
window width = 370. and window height = 360.
the window back color = {255,255,255}.
 
:note: "window controls"
i want label and label caption is "From"
i want textbox and textbox left is 50. and the textbox name is text1.
the textbox value is 10.
i want label and label caption is "To" and the label top is 50.
i want textbox and textbox left is 50. and the textbox name is text2.
the textbox value is 1.
the textbox top is 50.
i want listbox and listbox top is 100.
i want button and button caption is "Count backward"
the button top is 100. and the button left is 230.
the button name is btn1.
 
:note: "application task"
btn1 mouseclick. instructions are
        i want counter 
        text1. textbox selected and textbox value to [num1].
        text2. textbox selected and textbox value to [num2].
        get the counter start from [num1].
        get the counter end from [num2].
        the counter step is -1.
        the counter name is mycount1.
        you use counter 
        mycount1 change. instructions are
               counter value to [myvalue]. 
               listbox must add from [myvalue].
        end of instructions
end of instructions
 
You Show Window

This sample demonstrates dynamic GUI object creation at runtime. The user enters a number, and clicking "Create" generates that many buttons in three columns. Each button is created inside a counter loop, with its caption, position, and name set dynamically. Clicking any dynamically created button changes its background to yellow. This is a powerful example of how Supernova can create and configure GUI objects programmatically based on user input.

DynamicObjects.nova
:note: "application settings"
set window auto show off
set label transparent on
The application title is "Dynamic Objects"
 
:note: "application window"
I want window and the window title is "Dynamic Objects"
window width = 450. and window height = 500.
the window back color = {255,255,255}.
 
:note: "window controls"
i want label and label caption is "Enter Number"
i want textbox and textbox left is 100. and the textbox name is text1.
 
i want button and button caption is "Create"
the button left is 320. and the button name is btn1.
 
:note: "application task"
btn1 mouseclick. instructions are
        text1. textbox selected and textbox value to [num1].
        i want counter 
        the counter start is 1.
        get the counter end from [num1].
        the counter step is 1.
        the counter name is mycount1.
        [theleft]. = (30). and you use counter 
        [theleft]. = (150). and you use counter 
        [theleft]. = (270). and you use counter 
        mycount1 change. instructions are
               counter value to [myvalue]. 
               [mytop]. = [myvalue] x (50).
               i want button
               the button caption from [myvalue].
               the button top from [mytop].
               the button left from [theleft].
               the button backcolor is {255,255,255}.
               the button name is dynamicbutton.
               dynamicbutton mouseclick. instructions are
                       the button backcolor is {255,255,0}.
               end of instructions
        end of instructions
end of instructions
 
You Show Window
 
 

 
Sample Files
--------------
 
        1 - Case.nova
        2 - Cases.nova

This sample demonstrates conditional branching based on a counter value. As the counter iterates from a start value to an end value, each value is added to a listbox. When the counter reaches 3, an additional message "this is number three" is inserted. This uses the isequal comparison and state-based event handling (mytest true/false) to implement conditional logic within a loop.

Case.nova
:note: "application settings"
set window auto show off
set label transparent on
The application title is "Case Sample"
 
:note: "application window"
I want window and the window title is "Counter Sensitive to number 3"
window width = 370. and window height = 360.
the window back color = {255,255,255}.
 
:note: "window controls"
i want label and label caption is "From"
i want textbox and textbox left is 50. and the textbox name is text1.
the textbox value is 1.
i want label and label caption is "To" and the label top is 50.
i want textbox and textbox left is 50. and the textbox name is text2.
the textbox value is 10.
the textbox top is 50.
i want listbox and listbox top is 100.
i want button and button caption is "Count Forward"
the button top is 100. and the button left is 230.
the button name is btn1.
 
:note: "application task"
btn1 mouseclick. instructions are
        i want counter 
        text1. textbox selected and textbox value to [num1].
        text2. textbox selected and textbox value to [num2].
        get the counter start from [num1].
        get the counter end from [num2].
        the counter step is 1.
        the counter name is mycount1.
        you use counter 
        mycount1 change. instructions are
               counter value to [myvalue]. 
               listbox must add from [myvalue].
               [mytest]. = [myvalue] isequal (3).
               mytest true. instructions are
                       listbox must add item "this is number three"
               end of instructions
        end of instructions
end of instructions
 
You Show Window

This sample demonstrates a switch/case-like pattern in Supernova. As the counter iterates from 1 to 5, each number is matched against multiple cases (1 through 5), and the corresponding English word is prepended to the value before adding it to the listbox. For example, the number 3 becomes "Three 3". This showcases how state-based events can simulate a switch statement, mapping numeric values to descriptive labels.

Cases.nova
:note: "application settings"
set window auto show off
set label transparent on
The application title is "Cases Sample"
 
:note: "application window"
I want window and the window title is "Cases"
window width = 370. and window height = 360.
the window back color = {0,0,100}.
 
:note: "window controls"
i want label and label caption is "From"
the label fore color is {255,255,255}.
i want textbox and textbox left is 50. and the textbox name is text1.
the textbox value is 1.
i want label and label caption is "To" and the label top is 50.
the label fore color is {255,255,255}.
i want textbox and textbox left is 50. and the textbox name is text2.
the textbox value is 5.
the textbox top is 50.
i want listbox and listbox top is 100.
i want button and button caption is "Count Forward"
the button top is 100. and the button left is 230.
the button name is btn1.
 
:note: "application task"
btn1 mouseclick. instructions are
        i want counter 
        text1. textbox selected and textbox value to [num1].
        text2. textbox selected and textbox value to [num2].
        get the counter start from [num1].
        get the counter end from [num2].
        the counter step is 1.
        the counter name is mycount1.
        you use counter 
        mycount1 change. instructions are
               counter value to [myvalue]. and [mytest]. = [myvalue].
               :note: Cases.
               mytest 1. instructions are [myvalue]. = (One ) [myvalue]. ok
               mytest 2. instructions are [myvalue]. = (Two ) [myvalue]. ok
               mytest 3. instructions are [myvalue]. = (Three ) [myvalue]. ok
               mytest 4. instructions are [myvalue]. = (Four ) [myvalue]. ok
               mytest 5. instructions are [myvalue]. = (Five ) [myvalue]. ok
               listbox must add from [myvalue].
        end of instructions
end of instructions
 
You Show Window

This sample creates a quiz application that tests the user's knowledge. It displays a question ("Who is the creator of Supernova Programming Language?") with a listbox of answer choices. When the user selects an answer and clicks "Check Answer", the program evaluates whether the selected item matches the correct answer (option 2, "Mahmoud") using the isequal comparison, and displays "True Answer" or "False Answer" accordingly.

CheckAnswer.nova
The application title is "Check Answer"
Set window auto show off
 
I want window and the window title is "Test"
Window width = 730. and window height = 530.
 
I want label 
The label width is 700. and label height is 120.
The label font size is 20. 
The label back color = {255,255,255}.
The label caption is 
"
 Who is the creator of 
 Supernova Programming Language ?
"
 
I want listbox and listbox top is 150.
Listbox width is 700. and listbox height is 250.
The listbox must add item "Gudio"
The listbox must add item "Mahmoud"
The listbox must add item "Matz"
The listbox font size is 15.
 
I want button and the button top is 450.
The button left is 240. and button caption = "Check Answer"
The button name is btn1.
The button back color is {255,255,255}.
 
I want button and the button top is 450.
The button left is 360. and button caption = "End Application"
The button name is btnclose.
The button fore color is {255,255,255}.
The button back color is {255,0,0}.
btnclose mouseclick. instructions are you close application ok
 
You show window
 
btn1 mouseclick. instructions are
        The listbox value to [x].
        [mytest]. = [x] isequal (2). 
        mytest true. instructions are 
               The label caption is 
               "
                       True Answer
               " ok
        mytest false. instructions are 
               The label caption is 
               "
                       False Answer
               " ok
end of instructions
 
 

 
Sample Files
--------------
 
        1 - InfiniteLoop.nova
        2 - UnderControl.nova
        3 - Processing.nova

This sample demonstrates an infinite loop pattern in Supernova. It uses a state-based event (test false) that continuously increments a counter variable and adds the values to a listbox. The "do windows events" command inside the loop ensures the GUI remains responsive, allowing the user to interact with the "Close" button to exit the application. This shows how Supernova handles continuous processing while keeping the interface alive.

InfiniteLoop.nova
The application title is "Infinite Loop"
I want window contains listbox and the window title is "Infinite Loop"
the window name is mywin.
 
I want button and button caption is "Close"
the button name is "myclose" and the button left is 300.
myclose mouseclick. instructions are 
        you close window
end of instructions
 
[y]. = (0).
[x]. = (0).
 
[test]. = [y] isequal (1).
test false. instructions are
        [x]. = [x]+(1).
        listbox must add from [x].
        do windows events
        [test]. = [y] isequal (1).
end of instructions

This sample extends the infinite loop pattern by adding a "Stop" button that gives the user control over when the loop terminates. The loop runs while the counter variable is not equal to 10000, and clicking "Stop" sets the variable to 10000, which causes the loop condition to become true and the loop to end. This demonstrates user-controlled loop termination in Supernova's event-driven environment.

UnderControl.nova
The application title is "Loop Under Control"
I want window contains listbox and the window title is "Loop Under Control"
the window name is mywin.
 
I want button and button caption is "Close"
the button name is "myclose" and the button left is 300.
myclose mouseclick. instructions are 
        you close window
end of instructions
 
I want button and button caption is "Stop"
the button name is "mystop" and the button left is 300.
the button top is 80.
mystop mouseclick. instructions are 
        [y]. = (10000).
end of instructions
 
 
[y]. = (0).
 
[test]. = [y] isequal (10000).
test false. instructions are
        [y]. = [y]+(1).
        listbox must add from [y].
        do windows events
        [test]. = [y] isequal (10000).
end of instructions

This sample demonstrates a self-calling recursive loop pattern. The "myloop" procedure calls itself repeatedly using "instructions must done", incrementing a counter variable each time. The "do windows events" call inside the loop keeps the application responsive. When the counter reaches 100000, a state event triggers and closes the application automatically. This shows how Supernova can implement processing loops with automatic termination conditions.

Processing.nova
The application title is "Application will end after some processing"
 
[y]. = (0).
 
myloop. instructions must done
myloop. instructions are
        do windows events
        [y]. = [y]+(1).
        myloop. instructions must done
end of instructions
 
y 100000. instructions are You close application ok

Writing Flexibility

Supernova provides extensive writing flexibility:

1 — Not Case Sensitive   2 — Not Tab Sensitive   3 — Not Space Sensitive   4 — Not Line Sensitive

5 — Writing Data   6 — Writing Expressions   7 — Ignored words   8 — Words with same effect

Writing

Flexibility

1 - Not Case Sensitive

2 - Not Tab Sensitive

3 - Not Space Sensitive

4 - Not Line Sensitive

5 - Writing Data

6 - Writing Expressions

7 - Words ignored by the language compiler

8 - Words with the same effect

This sample proves that Supernova is not case sensitive. The same "I want window" command is written three different ways — all lowercase, ALL UPPERCASE, and MiXeD CaSe — and all three produce identical windows. This demonstrates that programmers can write in whatever case feels natural without affecting program behavior.

TestNotCaseSensitive.nova
i want window and the window title is Not.
the window top is 50.
I WANT WINDOW AND THE WINDOW TITLE IS Case.
the window top is 100.
I WaNt WiNdOw AnD ThE WiNdOw TiTlE Is Sensitive.
the window top is 150.

This sample demonstrates that Supernova ignores tab characters within statements. The command "i want window and the window title is Not Tab Sensitive" is written with tabs inserted between and within words, yet it executes correctly. This flexibility means formatting and indentation choices have no impact on program logic.

TestNotTabSensitive.nova
i       wa      nt window       and the win   dow title is Not Tab Sensitive.

This sample demonstrates that Supernova is not space sensitive. The same window creation command is written three ways: with normal spacing, with all spaces removed ("iwantwindowandthewindowtitleisSpace"), and with spaces between every letter. All three produce valid windows, showing that Supernova's parser intelligently tokenizes input regardless of spacing.

TestNotSpaceSensitive.nova
i want window and the window title is Not.
The window top is 50.
iwantwindowandthewindowtitleisSpace.
The window top is 100.
i w a n t w i n d o w a n d t h e w i n d o w t i t l e i s Sensitive .
The window top is 150.

This sample demonstrates that Supernova is not line sensitive. A single statement can be broken across multiple lines — even to the extreme of putting each letter on its own line — and the program still works correctly. This means programmers can format their code across lines for readability without worrying about line-break restrictions.

TestNotLineSensitive.nova
i want window and the window title is Not.
The window top is 50.
i
w a n t
w i n d o w
a n d
t h e
w i n d o w
t i t l e
is Line.
The window top is 100.
i
w
a
n
t
w i n d o w
a
n
d
t h e 
w i n
d o w
t i t 
l e i s Sensitive.
The window top is 150.

This sample demonstrates different ways to write string data in Supernova. It shows five variations: plain text without quotes, text in double quotes (which preserves special characters), text in single quotes, single quotes containing double quotes, and double quotes containing single quotes. Each approach produces a window with a different title, illustrating how Supernova handles various data quoting styles.

TestDataFlag.nova
I want window
The window title is Hello [1].
The window top is 50.
I want window 
The window title is "Hello...[2]"
The window top is 80.
I want window 
The window title is 'Hello...[3]'
The window top is 110.
I want window 
The window title is '"Hello...[4]"'
The window top is 140.
I want window 
The window title is "'Hello...[5]'"
The window top is 170.

This sample demonstrates the less-than comparison operator (<) in Supernova. It compares several values against a reference value of 20 and adds "True" or "False" to a listbox based on the comparison result. This uses state-based events (test true/test false) to branch based on comparison outcomes, showing how Supernova implements relational comparisons.

IsLessThan.nova
I want window contains listbox and window title is is greater than.
 
test true. instructions are the listbox must add item True. ok
test false. instructions are the listbox must add item False. ok
 
[v2]. = (20).
[v1]. = (25). and [test]. = [v1] < [v2].
[v1]. = (5).  and [test]. = [v1] < [v2].
[v1]. = (15). and [test]. = [v1] < [v2].
[v1]. = (28). and [test]. = [v1] < [v2].

This sample demonstrates the greater-than comparison operator (>) in Supernova. It tests multiple values against a reference value of 20, adding "True" or "False" to a listbox depending on whether each value exceeds the threshold. This complements the less-than sample and follows the same state-based event pattern.

IsGreaterThan.nova
I want window contains listbox and window title is is greater than.
the window name is win1.
 
test true. instructions are the listbox must add item True. ok
test false. instructions are the listbox must add item False. ok
 
[v2]. = (20).
[v1]. = (25). and [test]. = [v1] > [v2].
[v1]. = (5).  and [test]. = [v1] > [v2].
[v1]. = (15). and [test]. = [v1] > [v2].
[v1]. = (28). and [test]. = [v1] > [v2].

This sample demonstrates the less-than-or-equal comparison operator (<=) in Supernova. It tests several values against a reference of 20, including boundary cases like 20 and 21, to verify the operator handles equality correctly. Results are displayed as "True" or "False" in a listbox.

IsLessOrEqual.nova
I want window contains listbox and window title is is less or Equal.
 
test true. instructions are the listbox must add item True. ok
test false. instructions are the listbox must add item False. ok
 
[v2]. = (20).
[v1]. = (25). and [test]. = [v1] <= [v2].
[v1]. = (5).  and [test]. = [v1] <= [v2].
[v1]. = (21). and [test]. = [v1] <= [v2].
[v1]. = (20). and [test]. = [v1] <= [v2].

This sample demonstrates the greater-than-or-equal comparison operator (>=) in Supernova. It tests multiple values against a reference of 20, including the exact boundary value, confirming that the operator returns true for both greater-than and equal cases.

IsGreaterOrEqual.nova
I want window contains listbox and window title is is greater or Equal.
 
test true. instructions are the listbox must add item True. ok
test false. instructions are the listbox must add item False. ok
 
[v2]. = (20).
[v1]. = (25). and [test]. = [v1] >= [v2].
[v1]. = (5).  and [test]. = [v1] >= [v2].
[v1]. = (21). and [test]. = [v1] >= [v2].
[v1]. = (20). and [test]. = [v1] >= [v2].

This sample demonstrates the equality comparison operator (is equal / isequal) in Supernova. It assigns a value of 3 to a variable, checks if it equals 3, and when the test is true, changes the window title to "wow". This shows Supernova's conditional execution pattern using state-based events triggered by comparison results.

IsEqual.nova
i want window contains editbox
[mytest]. = (3).
[myif]. = [mytest] is equal (3).
 
myif true. instructions are
the window title is wow.
end of instructions

This sample demonstrates the not-equal comparison operator in Supernova. Similar to the equality test, it checks whether a variable's value differs from a given constant, and executes instructions based on the result, showcasing the inverse conditional pattern.

IsNotEqual.nova
i want window contains editbox
[mytest]. = (3).
[myif]. = [mytest] != (4).
 
myif true. instructions are
the window title is wow.
end of instructions

This sample creates a GUI window and configures its properties using Supernova's natural language statements. It demonstrates how to set up visual elements and their attributes declaratively.

Precedence.nova
I want window and the window title is Precedence.
The window height is 300. and window back color = {30,200,100}.
I want listbox and the listbox name is mylist1.
[v1]. = (3)+(15)x(3).
listbox must add from [v1].
[v1]. = (3)+(15)x(3)+(4)x(12).
listbox must add from [v1].
[v2]. = (3).
[v1]. = (6)+[v2]x(15).
listbox must add from [v1].
[v1]. = (6)x(15).
listbox must add from [v1].
[v1]. = (6)x(15)x(3).
listbox must add from [v1].

This sample demonstrates a simple while-loop pattern using Supernova's state-based events. A comparison ([x] < 10) is evaluated and stored in a variable, and when that variable is true, the loop body executes — incrementing x, adding it to a listbox, and re-evaluating the condition. This is the basic loop idiom in Supernova without using the "do while" syntax.

GoodLoop1.nova
i want window contains listbox
 
[loop]. = [x] < (10). and loop true. instructions are
        [x]. = [x] + (1).
        listbox must add from [x].
        [loop]. = [x] < (10). 
end of instructions

This sample demonstrates a loop with compound conditions using both >= and <= operators combined with AND. It iterates from 10 to 100, adding each value to a listbox. The loop condition uses two comparisons joined by AND to establish a range, showing how Supernova supports compound Boolean expressions in loop conditions.

GoodLoop2.nova
i want window contains listbox
 
[x]. = (10).
[loop]. = [x] >= (10) and [x] <= (100). and loop true. instructions are
        listbox must add from [x].
        [x]. = [x] + (1).
        [loop]. = [x] >= (10) and [x] <= (100).
end of instructions

This sample extends the loop pattern by using variables for the start and end values instead of hard-coded constants. The loop runs from [mystart] to [myend], making it fully dynamic. This demonstrates how Supernova variables can be used in loop conditions for more flexible iteration ranges.

GoodLoop3.nova
i want window contains listbox
 
[mystart]. = (10). and [myend]. = (100). and [x]. = [mystart].
[loop]. = [x] >= [mystart] and [x] <= [myend]. 
loop true. instructions are
        listbox must add from [x].
        [x]. = [x] + (1).
        [loop]. = [x] >= [mystart] and [x] <= [myend].
end of instructions

This sample provides a comprehensive test of Boolean operations in Supernova. It evaluates AND, OR, and NOT operations using both literal values (True/False) and variables, adding each result to a listbox. It tests combinations like "True and False", "True or False", "not False", "True or not True", and "True and not True", serving as a complete Boolean logic reference.

CheckAndOrNot.nova
i want window contains listbox
 
listbox must add item "test using values"
 
[x]. = (True) and (False).
listbox must add from [x].
 
[x]. = (True) or (False).
listbox must add from [x].
 
[x]. = not (False).
listbox must add from [x].
 
[x]. = not (True).
listbox must add from [x].
 
[x]. = (True) or not (True).
listbox must add from [x].
 
[x]. = (True) and not (True).
listbox must add from [x].
 
listbox must add item "test using variables"
 
[a]. = (True). [b]. = (False).
 
[x]. = [a] and [b].
listbox must add from [x].
 
[x]. = [a] or [b].
listbox must add from [x].
 
[x]. = not [b].
listbox must add from [x].
 
[x]. = not [a].
listbox must add from [x].
 
[x]. = [a] or not [a].
listbox must add from [x].
 
[x]. = [a] and not [a].
listbox must add from [x].

This sample demonstrates range checking — testing whether a user-entered value falls within a specific range (greater than 5 and less than 10). The user enters a value in a textbox, clicks "test value", and the program evaluates the compound condition, adding "True" or "False" to a listbox. This is a practical example of combining comparison operators with AND for boundary validation.

ValueInRange.nova
i want window contains listbox
the window title is the test is true when   5 < thevalue < 10.
 
i want textbox and i want button
the button left is 300.
the button caption is test value.
the button name is btn1.
the listbox top is 50.
 
btn1 mouseclick. instructions are
        store the textbox value to [x].
        [mytest]. = [x] > (5) and [x] < (10).
ok
 
mytest true. instructions are
listbox  must add item True.
ok
 
mytest false. instructions are
listbox  must add item False.
ok

This sample demonstrates the various assignment syntax options in Supernova. It shows string concatenation with "is", arithmetic with "=", the "equal" keyword, variable interpolation, Boolean operations in assignments, array-like pipe syntax, and undefined variable handling. Two listboxes display the assignment expressions alongside their computed results, serving as a comprehensive reference for Supernova's assignment capabilities.

Assignment.nova
I want window and the window title is Assignment.
The window height is 300. and window back color = {30,200,100}.
I want listbox and the listbox name is mylist1.
i want listbox and the listbox name is mylist2.
listbox left is 250.
[v1]. is ( Hello )( World ).
[v2]. = (15)x(3).
[v3]. equal (Country).
[v4]. = (Hello)[v1].
[v5]. = (12) and (7) or (1) not (13).
[v6]. = | (1) [One] (2) [Two] |.
[v7]. = (Hello )[GoodName].
mylist2. listbox selected
listbox must add item "[v1]. is ( Hello )( World )."
listbox must add item "[v2]. = (15)x(3)."
listbox must add item "[v3]. equal (Country)."
listbox must add item "[v4]. = (Hello)[v1]."
listbox must add item "[v5]. = (12) and (7) or (1) not (13)."
listbox must add item "[v6]. = | (1) [One] (2) [Two] |."
listbox must add item "[v7]. = (Hello )[GoodName]."
mylist1. listbox selected
listbox must add from [v1].
listbox must add from [v2].
listbox must add from [v3].
listbox must add from [v4].
listbox must add from [v5].
listbox must add from [v6].
listbox must add from [v7].

The following reference block explains which words are silently ignored by the Supernova compiler. The words "The", "And", "Get", and "Store" are optional connector words that can be included for readability but have no effect on program execution. For example, "The window title is hello" and "window title is hello" are identical to the compiler.

code
Words ignored by the compiler
-------------------------------
 
1 - (The)
Example: The window title is hello.
        **OR**
         Window title is hello.
2 - (And)
        I want window and window title is wow.
        **OR**
        I want window window title is wow.
3 - (Get)
        [mytitle] = (Hello World).
        window title from [mytitle].
        **OR**
        [mytitle] = (Hello World).
        Get window title from [mytitle].
4 - (Store)
        window title to [X].
        **OR**
        Store window title to [X].

The following reference block lists groups of interchangeable words in Supernova. "Want" and "See" are equivalent verbs for creating objects. "Is", "Equal", and "=" all perform assignment. "Contains" and "I want" both create child controls. "OK" and "End of instructions" both close instruction blocks. "You" and "Please" are interchangeable pronouns. This flexibility lets programmers write in whatever style feels most natural.

code
Words with the same effect
----------------------------
 
1 - (Want)  and (See) 
    Example : I want window
              **OR**
              I see window
2 - (Is), (Equal) and (=)
    Example : Window title is wow.
              **OR**
              Window title equal wow.
              **OR**
              Window title = wow.
3 - (Contains) and (I want)
    Example : I want window 
              I want listbox
              **OR**
              I want window contains listbox
 
4 - (OK) and (End of instructions)
    Example : 
              win1 mouseclick. instructions are
                       You close window
              End of instructions
              **OR**
              win1 mouseclick. instructions are
                       You close window
              ok
            
5 - (You) and (Please)
    Example : 
              You close window
              **OR**
              Please close window

Do Statements

Do

Statements

[1] Do While

....Data as Expression....

....Instructions....

End While

[2] Do If

....Data as Expression....

....Instructions....

End If

[3] Do

Function ....function name....

Function ....function name....

....Instructions....

End Function

Note: We can use OK | End of instructions instead of End Function

[4] Do

Procedure ....procedure name....

Procedure ....procedure name....

....Instructions....

End Procedure

Note: We can use OK | End of instructions instead of End Procedure

[5] Do

File ...."FileName.nova"....

This sample demonstrates Supernova's structured control flow statements: "do while" for loops and "do if" for conditional execution. It uses nested loops to build and display number patterns in a listbox — the outer loop counts from 1 to 7, and when the counter reaches 5, an inner loop generates an accumulating string. A second loop generates another pattern with a special marker at position 6. This showcases the power of nested do while/do if constructs.

DoStatements.nova
Set window auto show off
 
Application title = Do Statements.
 
i want window contains listbox
window title = Do Statements.
Window Width = 270.  listbox Width = 250.
Window Height = 500. listbox Height = 450.
listbox font size = 14.
listbox back color = {20,255,100}.
 
[x]. = (1). and do while [x] <= (7).
                       listbox must add from [x].
                       do if [x] == (5).
                               [t]. = .
                               [y]. = (1). and do while [y] <= (5).
                                                     [t]. = [t] [y].
                                                     listbox must add from [t].
                                                     [y]. = [y] + (1).
                                              end while
                       end if
                       [x]. = [x] + (1).
               end while
               [t]. = .
               [y]. = (1). and do while [y] <= (7).
                                      [t]. = [t] [y].
                                      listbox must add from [t].
                                      [y]. = [y] + (1).
                                      do if [y] == (6).
                                              listbox must add item ***********.
                                      end if
                               end while
 
You show window

This sample demonstrates Supernova's function and procedure mechanisms along with the "do file" command for including external libraries. It loads a UI library from "mylib.nova", calls a procedure to create the interface, then uses two functions: "myfunc" which squares a number, and "myfunc2" which doubles a number. The results are displayed in a listbox, showing how to define, call, and chain function results in expressions.

DoFunctionStatement.nova
application title = "Do Function"
 
do file "mylib.nova"
 
do procedure myuserinterface.
window title = "Do Function"
 
[input]. = (5). do function myfunc. listbox must add from [output].
[input]. = (3). do function myfunc2. listbox must add from [output].
 
You show window
 
Function myfunc.
        [output]. = [input]x[input].
End function
 
Function myfunc2. and [output]. = [input] x (2). ok

This is a reusable library file that defines a procedure called "myuserinterface". When called, it creates a window containing a listbox with custom dimensions and a white background. This demonstrates how Supernova supports code reuse through procedures stored in separate files, which can be included via the "do file" command.

MyLib.nova
procedure myuserinterface.
 
        i want window contains listbox
        window height = 450. 
        listbox height = 400.
        window width = 230. 
        window back color = {255,255,255}. 
        
end procedure

Strings

Strings

[1] Len

....String....

[mylen]. = len (Hello

World).

[2]

....Letters Count.... Left ....String....

[myleft]. = (5) left (Hello

World).

[3] ....Letters

Count.... Right ....String....

[myright]. = (5) right (Hello

World).

[4] Alltrim

....String....

[mymsg]. = alltrim ( Hello World

).

[5] RTrim

....String....

[mymsg]. = rtrim ( Hello World

).

[6] LTrim

....String....

[mymsg]. = ltrim ( Hello World

).

[7] Upper

....String....

[upper]. = upper (Hello World).

[8] Lower

....String....

[lower]. = lower (Hello

World).

[9]

....Count.... Replicate ....String....

[newstr]. = (3) replicate ( wow

).

[10]

....Index.... Inside ....String....

[myletter]. = (3) inside (Hello

World).

[11]

....SubString.... At ....String....

[pos]. = (llo) at (Hello

World).

[12] ....(RangeFrom:RangeTo)....

SubStr ....String....

[substr]. = (3:5) substr (Hello

World).

[13]

....(SubStringFrom:SubStringTo).... Transform ....String....

[transform]. = (World)(:)(RealWorld)

This sample demonstrates the Len string function, which returns the length of a string. The user enters text in a textbox, clicks the button, and the program calculates and displays the character count in a label. This is the most basic string operation in Supernova.

[1] StrLen.nova
Application title = StrLen.
 
I want window contains textbox and window title = Get String Length.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = get string length. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [myvar]. = len [mytext].
        label caption from [myvar].
end of instructions

This sample demonstrates the Left string function, which extracts a specified number of characters from the beginning of a string. When the button is clicked, it takes the first 5 characters from the textbox input and displays them in a label.

[2] StrLeft.nova
Application title = StrLeft.
 
I want window contains textbox and window title = Get Sub String From Left.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Get 5 letters from left. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext]. 
        [mytext]. = (5) left [mytext]. 
        label caption from [mytext].
end of instructions

This is an enhanced version of the Left string function demo. It provides two textboxes — one for the source string and one for the number of characters to extract. As the user changes the count, the button caption dynamically updates to reflect the current setting, demonstrating real-time UI updates through the textbox change event.

[3] StrLeft2.nova
Application title = StrLeft2.
 
I want window contains textbox and window title = Get Sub String From Left.
the textbox name is text1.
 
I want textbox and textbox top is 50.
the textbox name is text2.
 
I want label and label top is 100.
 
I want button and button name is btn1. and button left = 300.
Button caption = Get n letters from left. and button width = 150.
btn1 mouseclick. instructions are
        text1. textbox selected and textbox value to [mytext1]. 
        text2. textbox selected and textbox value to [mytext2]. 
        [mytext]. = [mytext2] left [mytext1]. 
        label caption from [mytext].
end of instructions
 
text2 change. instructions are
        textbox value to [mytext]. 
        the button caption from (Get ) [mytext] ( letters from left).
end of instructions

This sample demonstrates the Right string function, which extracts a specified number of characters from the end of a string. Clicking the button takes the last 5 characters from the input and displays them in a label — the mirror operation of Left.

[4] StrRight.nova
Application title = StrRight.
 
I want window contains textbox and window title = Get Sub String From Right.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Get 5 letters from right. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [mytext]. = (5) right [mytext].
        label caption from [mytext].
end of instructions

This is an enhanced version of the Right string function with a dynamic character count. Like StrLeft2, it provides a second textbox for the user to specify how many characters to extract from the right side of the string, with the button caption updating in real time.

[5] StrRight2.nova
Application title = StrRight2.
 
I want window contains textbox and window title = Get Sub String From Right.
the textbox name is text1.
 
I want textbox and textbox top is 50.
the textbox name is text2.
 
I want label and label top is 100.
 
I want button and button name is btn1. and button left = 300.
Button caption = Get n letters from Right. and button width = 150.
btn1 mouseclick. instructions are
        text1. textbox selected and textbox value to [mytext1]. 
        text2. textbox selected and textbox value to [mytext2]. 
        [mytext]. = [mytext2] right [mytext1]. 
        label caption from [mytext].
end of instructions
 
text2 change. instructions are
        textbox value to [mytext]. 
        the button caption from (Get ) [mytext] ( letters from right).
end of instructions

This sample demonstrates the Alltrim string function, which removes whitespace from both the beginning and end of a string. When the button is clicked, it trims the textbox input and displays the cleaned result in a label.

[6] StrAlltrim.nova
Application title = StrAlltrim.
 
I want window contains textbox and window title = Alltrim.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Alltrim. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [myvar]. = Alltrim [mytext].
        label caption from [myvar].
end of instructions

This sample demonstrates the Rtrim string function, which removes trailing whitespace from the right side of a string only. This is useful when you want to preserve leading spaces but clean up trailing ones.

[7] StrRtrim.nova
Application title = StrRtrim.
 
I want window contains textbox and window title = Rtrim.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Rtrim. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [myvar]. = Rtrim [mytext].
        label caption from [myvar].
end of instructions

This sample demonstrates the Ltrim string function, which removes leading whitespace from the left side of a string only. This is the counterpart to Rtrim, preserving trailing spaces while cleaning the front.

[8] StrLtrim.nova
Application title = StrLtrim.
 
I want window contains textbox and window title = Ltrim.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Ltrim. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [myvar]. = Ltrim [mytext].
        label caption from [myvar].
end of instructions

This sample demonstrates the Upper string function, which converts all characters in a string to uppercase. The user enters text, clicks the button, and the fully capitalized result is displayed in a label.

[9] StrUpper.nova
Application title = StrUpper.
 
I want window contains textbox and window title = Upper.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Upper. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [myvar]. = Upper [mytext].
        label caption from [myvar].
end of instructions

This sample demonstrates the Lower string function, which converts all characters in a string to lowercase. This is the inverse of the Upper function, producing an all-lowercase result.

[10] StrLower.nova
Application title = StrLower.
 
I want window contains textbox and window title = Lower.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Lower. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [myvar]. = Lower [mytext].
        label caption from [myvar].
end of instructions

This sample demonstrates the Replicate string function, which repeats a string a specified number of times. When the button is clicked, the input text is replicated 3 times and the result is displayed in a label — useful for generating repeated patterns.

[11] StrReplicate.nova
Application title = StrReplicate.
 
I want window contains textbox and window title = Replicate String.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Replicate String. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext]. 
        [mytext]. = (3) Replicate [mytext]. 
        label caption from [mytext].
end of instructions

This is an enhanced version of the Replicate function with a user-specified repeat count. The second textbox lets the user enter how many times to repeat the string, and the button caption updates dynamically to show the current count. This demonstrates combining string functions with interactive UI controls.

[12] StrReplicate2.nova
Application title = StrReplicate2.
 
I want window contains textbox and window title = Replicate String.
the textbox name is text1.
 
I want textbox and textbox top is 50.
the textbox name is text2.
 
I want label and label top is 100. and label width = 400.
 
I want button and button name is btn1. and button left = 300.
Button caption = Replicate string n times. and button width = 150.
btn1 mouseclick. instructions are
        text1. textbox selected and textbox value to [mytext1]. 
        text2. textbox selected and textbox value to [mytext2]. 
        [mytext]. = [mytext2] replicate [mytext1]. 
        label caption from [mytext].
end of instructions
 
text2 change. instructions are
        textbox value to [mytext]. 
        the button caption from (Replicate String ) [mytext] ( times).
end of instructions

This sample demonstrates the Inside string function, which retrieves a single character at a specific position within a string. Clicking the button extracts the 3rd character from the input and displays it in a label. Positions are 1-based in Supernova.

[13] StrInside.nova
Application title = StrInside.
 
I want window contains textbox and window title = Char Inside String.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Get Char Inside String. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext]. 
        [mytext]. = (3) Inside [mytext]. 
        label caption from [mytext].
end of instructions

This is an enhanced version of the Inside function where the user can specify which character position to extract. The second textbox accepts the index number, and the button caption updates dynamically to reflect the chosen position.

[14] StrInside2.nova
Application title = StrInside2.
 
I want window contains textbox and window title = Get Char n Inside String.
the textbox name is text1.
 
I want textbox and textbox top is 50.
the textbox name is text2.
 
I want label and label top is 100. and label width = 400.
 
I want button and button name is btn1. and button left = 300.
Button caption = Get Char n Inside String. and button width = 150.
btn1 mouseclick. instructions are
        text1. textbox selected and textbox value to [mytext1]. 
        text2. textbox selected and textbox value to [mytext2]. 
        [mytext]. = [mytext2] Inside [mytext1]. 
        label caption from [mytext].
end of instructions
 
text2 change. instructions are
        textbox value to [mytext]. 
        the button caption from (Get Char ) [mytext] ( Inside String).
end of instructions

This sample demonstrates iterating through every character in a string using the Inside function inside a Do While loop. It first calculates the string length with Len, then loops from position 1 to the length, extracting and displaying each character individually in a listbox. This is a practical character-by-character string traversal example.

[15] StrInside3.nova
Application title = StrInside3.
 
I want window contains textbox and window title = Letters Inside String.
 
I want listbox and listbox top is 100. 
 
I want button and button name is btn1. and button left = 300.
Button caption = Letters Inside String. and button width = 150.
btn1 mouseclick. instructions are
        the textbox value to [mytext1]. 
        [mysize]. = len [mytext1].
        [x]. = (1). do while [x] <= [mysize].
               [mytext]. = [x] Inside [mytext1]. 
               listbox must add from [mytext].
               [x]. = [x] + (1).
        end while
end of instructions

This sample demonstrates the At string function, which finds the position of a substring within a larger string. The user enters the main string in one textbox and the search substring in another. Clicking the button returns the starting position of the first occurrence of the substring.

[16] StrAt.nova
Application title = StrAt.
 
I want window contains textbox and window title = Get Pos of Sub String.
the textbox name is text1.
 
I want textbox and textbox top is 50.
the textbox name is text2.
 
I want label and label top is 100. and label width = 400.
 
I want button and button name is btn1. and button left = 300.
Button caption = Get Pos of Sub String. and button width = 150.
btn1 mouseclick. instructions are
        text1. textbox selected and textbox value to [mytext1]. 
        text2. textbox selected and textbox value to [mytext2]. 
        [mytext]. = [mytext2] at [mytext1]. 
        label caption from [mytext].
end of instructions

This sample demonstrates the Substr string function, which extracts a range of characters from a string. The range is specified as (start:count), so "(3:5) substr" extracts 5 characters starting at position 3. The result is displayed in a label.

[17] StrSubstr.nova
Application title = StrSubStr.
 
I want window contains textbox and window title = Get Sub String.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Get Sub String. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [myvar]. = (3:5) substr [mytext].
        label caption from [myvar].
end of instructions

This is an enhanced version of the Substr function that uses variables for the range parameters. It constructs the range dynamically by concatenating two variables with a colon separator, demonstrating that Supernova's string functions can work with computed range expressions.

[18] StrSubstr2.nova
Application title = StrSubStr2.
 
I want window contains textbox and window title = Get Sub String.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Get Sub String. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [x1]. = (5).
        [x2]. = (5).
        [range]. = [x1](:)[x2].
        [myvar]. = [range] substr [mytext].
        label caption from [myvar].
end of instructions

This sample demonstrates the Transform string function, which performs find-and-replace operations on a string. The syntax "(old:new) transform [string]" replaces all occurrences of "old" with "new". In this case, it replaces "nova" with "*nova*" in the input text, wrapping matches in asterisks.

[19] StrTransform.nova
Application title = StrTransform.
 
I want window contains textbox and window title = Transform.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = Sub String Transform. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [myvar]. = (nova:*nova*) transform [mytext].
        label caption from [myvar].
end of instructions

This is an enhanced version of the Transform function with user-configurable search and replacement strings. Three textboxes allow the user to specify the source text, the substring to find, and the replacement text. This provides a fully interactive find-and-replace tool built entirely in Supernova.

[20] StrTransform2.nova
Application title = StrTransform.
 
I want window contains textbox and window title = Transform.
textbox name is text1.
textbox value is wow nova wow.
 
I want label and label top is 150. and label width = 400.
 
I want textbox and textbox top = 50.
textbox name is text2.
textbox value is nova.
 
I want textbox and textbox top = 100.
textbox name is text3.
textbox value is *nova*.
 
I want button and button name is btn1. and button left = 300.
button caption = Sub String Transform. and button width = 150.
btn1 mouseclick. instructions are
        text1. textbox selected and textbox value to [mytext].
        text2. textbox selected and textbox value to [str1].
        text3. textbox selected and textbox value to [str2].
        [myvar]. = [str1](:)[str2] transform [mytext].
        label caption from [myvar].
end of instructions

Date and Time

Date And

Time

[1] The Date

[mydate]. = the date.

[2] The Time

[mytime]. = the time.

[3] The

Seconds

[myseconds]. = the seconds.

[4] The Day

[myday]. = the day.

[5] The

Month

[mymonth]. = the month.

This sample demonstrates the "the date" built-in function, which retrieves the current system date. It creates a window with a white background and displays the current date in a large 40-point font label, providing a simple date display widget.

[1] TheDate.nova
Application title = The Date.
 
I want window and window title = The Date.
window back color = {255,255,255}.
window width = 330.  window height = 150.
 
I want label and label caption from the date.
The label font size = 40. and label width = 300. 
label height = 100.

This sample demonstrates the "the day" built-in function, which retrieves the current day of the month. Like the date display, it shows the day number in a large font label on a white-background window.

[2] TheDay.nova
Application title = The Day.
 
I want window and window title = The Day.
window back color = {255,255,255}.
window width = 330.  window height = 150.
 
I want label and label caption from the Day.
The label font size = 40. and label width = 300. 
label height = 100.

This sample demonstrates the "the month" built-in function, which retrieves the current month number. It displays the month in a large font label, completing the set of individual date component retrieval functions.

[3] TheMonth.nova
Application title = The Month.
 
I want window and window title = The Month.
window back color = {255,255,255}.
window width = 330.  window height = 150.
 
I want label and label caption from the Month.
The label font size = 40. and label width = 300. 
label height = 100.

This sample demonstrates the "the seconds" built-in function, which retrieves a high-precision seconds value. It displays the current seconds in a large font label on a gray-background window, useful as a timestamp or for timing operations.

[4] TheSeconds.nova
Application title = The Seconds.
 
I want window and window title = The Seconds.
window back color = {155,155,155}.
window width = 330.  window height = 150.
 
I want label and label caption from the seconds.
The label font size = 40. and label width = 300. 
label height = 100.

This sample demonstrates the "the time" built-in function, which retrieves the current system time as a formatted string. It displays the full time in a large font label on a gray-background window.

[5] TheTime.nova
Application title = The Time.
 
I want window and window title = The Time.
window back color = {155,155,155}.
window width = 330.  window height = 150.
 
I want label and label caption from the time.
The label font size = 40. and label width = 300. 
label height = 100.

This sample creates a live seconds counter that continuously updates the display. It uses a "do while (True)" infinite loop with a delay mechanism (comparing elapsed seconds) to update the label approximately 10 times per second. The "do windows events" call inside the loop keeps the GUI responsive, and a Close button lets the user exit the application.

[6] TheSeconds2.nova
Application title = The Seconds.
 
I want window and window title = The Seconds.
window back color = {5,155,255}.
window width = 330.  window height = 250.
window name = win1.
 
I want label 
The label font size = 40. and label width = 300. 
label height = 100.
 
I want button and button caption = Close.
the button name is btn1.
button top = 150. and button left = 150.
 
do while (True).
        label caption from (   ) the Seconds.
        [x]. = the seconds. and do while "the seconds - [x] < (0.1)"
                                      do windows events
                               end while 
end while
 
btn1 mouseclick. instructions are
        You close application
end of instructions

This sample creates a live clock that displays the current time and updates every second. Similar to TheSeconds2, it uses an infinite loop with a 1-second delay between updates. The time is refreshed each second in the label, creating a functional real-time clock widget with a Close button for graceful exit.

[7] TheTime2.nova
Application title = The Time.
 
I want window and window title = The Time.
window back color = {5,155,255}.
window width = 330.  window height = 250.
window name = win1.
 
I want label 
The label font size = 40. and label width = 300. 
label height = 100.
 
I want button and button caption = Close.
the button name is btn1.
button top = 150. and button left = 150.
 
do while (True).
        label caption from (   ) the time.
        [x]. = the seconds. and do while the seconds - [x] < (1).
                                      do windows events
                               end while 
end while
 
btn1 mouseclick. instructions are
        You close application
end of instructions

This sample creates a fun, interactive friendship application with animated color effects. It displays a "Be my friend" button, and when the user confirms, it triggers a continuous loop that alternates the window background between different colors (red, white, yellow) with timed delays, creating a flashing celebration effect. This demonstrates creative use of timed loops and dynamic property changes for visual animations.

[8] Flash.nova
Application title = Hello!!.
 
I want window and window title = Hello!!.
Window back color = {5,155,255}.
Window width = 330.  window height = 250.
Window name = win1.
 
I want button and button caption = Be my friend , click to say yes !!.
The button top = 20. button width = 300.
The button name = btn1.
 
I want button the button top = 80.
Button caption = . and the button name = btn2.
 
I want button the button top = 130.
Button caption = . and the button name = btn3.
 
 
btn1 mouseclick. instructions are
        Btn2. button selected and button caption = Really !! ? .
End of instructions    
 
 
btn2 mouseclick. instructions are
Do while (True).
        Btn3. button selected and button caption = Hurrah.
        [x]. = the seconds. and do while "the seconds - [x] < (0.5)"
                                      Do windows events
                               End while 
        Btn3. button selected and button caption = .
        [x]. = the seconds. and do while "the seconds - [x] < (0.5)"
                                      Do windows events
                               End while 
End while
End of instructions
 
btn3 mouseclick. instructions are
        You close window
End of instructions

Arrays

Arrays

[array name]\[element index as variable]

[array name]\(element index as value)

[array name-element index as value]

Multi-dimension arrays supported by using nested \

This sample creates a GUI window and configures its properties using Supernova's natural language statements. It demonstrates how to set up visual elements and their attributes declaratively.

[1] Array.nova
Application title = "Array"
I want window contains listbox and the window title is Array.
listbox height = 500. 
window height = 550. window width = 230.
 
[x]. = (1). and Do while [x] <= (10).
                       [myarray]\[x]. = [x] x [x].
                       [x]. = [x] + (1).
               End while
 
listbox must add item Using the first method.
 
listbox must add from [myarray-1].
listbox must add from [myarray-2].
listbox must add from [myarray-3].
listbox must add from [myarray-4].
listbox must add from [myarray-5].
listbox must add from [myarray-6].
listbox must add from [myarray-7].
listbox must add from [myarray-8].
listbox must add from [myarray-9].
listbox must add from [myarray-10].
 
listbox must add item Using the second method.
 
listbox must add from [myarray]\(1).
listbox must add from [myarray]\(2).
listbox must add from [myarray]\(3).
listbox must add from [myarray]\(4).
listbox must add from [myarray]\(5).
listbox must add from [myarray]\(6).
listbox must add from [myarray]\(7).
listbox must add from [myarray]\(8).
listbox must add from [myarray]\(9).
listbox must add from [myarray]\(10).
 
listbox must add item Using the third method.
 
[x]. = (1). and Do while [x] <= (10).
                       listbox must add from [myarray]\[x].
                       [x]. = [x] + (1).
               End while

This sample creates a GUI application with interactive controls and event handlers. It demonstrates window creation, control placement and configuration, and user interaction through Supernova's natural language syntax.

[2] Array2.nova
Application title = "Array2"
I want window and the window title is Array2.
Window width = 350. window height = 300.
 
i want button and button caption = close. and button name = btn1.
button top = 230. and button width = 330.
btn1 mouseclick. instructions are you close window ok
 
i want listbox and the listbox left = 10. and listbox name = list1.
listbox width = 100.
 
i want listbox and the listbox left = 120. and listbox name = list2.
listbox width = 100.
 
i want listbox and the listbox left = 240. and listbox name = list3.
listbox width = 100.
 
[x]. = (1). and Do while [x] <= (10).
                       [myarray]\[x]\(1). = [x].
                       [myarray]\[x]\(2). = [x] x [x].
                       [myarray]\[x]\(3). = [x] x [x] x [x].
                       [x]. = [x] + (1).
               End while
 
[x]. = (1). and Do while [x] <= (10).
                       list1. listbox selected 
                       listbox must add from [myarray]\[x]\(1).
                       list2. listbox selected 
                       listbox must add from [myarray]\[x]\(2).
                       list3. listbox selected 
                       listbox must add from [myarray]\[x]\(3).
                       [x]. = [x] + (1).
               End while

Macro

Macro

[1] Get

Variable ....Variable/Value Point to Variable Name....

[2] Do

Function ....Variable/Value Point to Function Name....

This sample creates a GUI application with interactive controls and event handlers. It demonstrates window creation, control placement and configuration, and user interaction through Supernova's natural language syntax.

[1] GetVariable.nova
Application title = GetVariable.
 
I want window contains textbox and window title = GetVariable.
Window height = 130.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = GetVariable. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        label caption from get variable (mytext).
end of instructions

This sample creates a GUI application with interactive controls and event handlers. It demonstrates window creation, control placement and configuration, and user interaction through Supernova's natural language syntax.

[2] DoFunction.nova
Application title = DoFunction.
 
I want window contains textbox and window title = DoFunction.
Window height = 130.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = DoFunction. and button width = 150.
btn1 mouseclick. instructions are
        label caption from do function (myfunc).
end of instructions
 
function myfunc.
        textbox value to [mytext].
        [output]. = [mytext] x [mytext].
end function

This sample creates a GUI application with interactive controls and event handlers. It demonstrates window creation, control placement and configuration, and user interaction through Supernova's natural language syntax.

[3] Pointer2Variable.nova
Application title = Pointer2Variable.
 
I want window contains textbox and window title = Pointer2Variable.
Window height = 130.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = GetVariable. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        [mytext]. = Alltrim [mytext].
        [myselector]. = (mytext).
        label caption from get variable [myselector].
end of instructions

This sample demonstrates function pointers — calling a function by name stored in a variable. The function name "myfunc" is stored in a variable, and "do function [myfunctionname]" executes it indirectly. The function squares the textbox input and returns the result. This enables dynamic function dispatch in Supernova.

[4] Pointer2Function.nova
Application title = Pointer2Function.
 
I want window contains textbox and window title = Pointer2Function.
Window height = 130.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = DoFunction. and button width = 150.
btn1 mouseclick. instructions are
        [myfunctionname]. = (myfunc).
        label caption from do function [myfunctionname].
end of instructions
 
function myfunc.
        textbox value to [mytext].
        [output]. = [mytext] x [mytext].
end function

This sample demonstrates using function calls within expressions. It calls the same function twice and adds the results together: "do function (myfunc) + do function (myfunc)". The function squares the textbox input, so the label displays double the square. This shows that function calls in Supernova can be composed inline within arithmetic expressions.

[5] DoFunction2.nova
Application title = DoFunction2.
 
I want window contains textbox and window title = DoFunction2.
Window height = 130.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = DoFunction. and button width = 150.
btn1 mouseclick. instructions are
        label caption from do function (myfunc) + do function (myfunc).
end of instructions
 
function myfunc.
        textbox value to [mytext].
        [output]. = [mytext] x [mytext].
end function

This sample demonstrates using the "get variable" function within expressions. It retrieves a variable by name twice and multiplies the values: "get variable (mytext) x get variable(mytext)", effectively squaring the textbox value. This shows that indirect variable access can be used as operands in arithmetic expressions.

[6] GetVariable2.nova
Application title = GetVariable2.
 
I want window contains textbox and window title = GetVariable2.
Window height = 130.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = GetVariable. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [mytext].
        label caption from get variable (mytext) x get variable(mytext).
end of instructions

This sample calculates a factorial using an iterative (non-recursive) approach. The function "myfunc" uses a "do while" loop to multiply the output by decreasing values of the input until it reaches 1. This demonstrates how Supernova can implement classic algorithms using its loop constructs without recursion.

[7] NoRecursive.nova
Application title = NoRecursive.
 
I want window contains textbox and window title = NoRecursive.
Window height = 130.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = DoFunction. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [input].
        label caption from do function (myfunc).
end of instructions
 
function myfunc.       
        [output]. = [input].
        do while [input] > (1).
               [input]. = [input] - (1).
               [output]. = [output] x [input].
        end while
end function

This sample calculates a factorial using recursion. The function "myfunc" multiplies the output by the current input, decrements the input, and calls itself again if the input is still greater than 1. This demonstrates that Supernova supports recursive function calls, enabling elegant solutions for problems like factorial computation.

[8] Recursive.nova
Application title = Recursive.
 
I want window contains textbox and window title = Recursive.
Window height = 130.
 
I want label and label top is 50.
 
I want button and button name is btn1. and button left = 300.
button caption = DoFunction. and button width = 150.
btn1 mouseclick. instructions are
        textbox value to [input].
        label caption from do function (myfunc). 
end of instructions
 
function myfunc.
        [output]. = [output] x [input].
        [input]. = [input] - (1).
        do if [input] > (1).
               do function myfunc.
        end if
end function

Looking to the Future

Fiction Description

By Looking To The Future

[1]

Knowledge Power

Supernova know that any variable may exist at any time

In the future so you can use any variable without declaration

And without Assigning a value to it.

[2]

Expression Power

Supernova suggest that the initial [x] value is (1)

When you write [x] x (5).

Supernova suggest that the initial [x] value is (0)

When you write [x] + (5).

[3] Events

Power

There are two types of events allowed

1 - Object Events

Example : button mouse click event

btn1 mouseclick. instructions are

....instructions here....

end of instruction

2 - State Events (Event Based on Variable Value)

Example : an Event triggered when x = 10

x 10. instructions are

....instructions here....

end of instruction

Supernova look to future and enable us to write events

before creating objects in the case of Object Events and/or

before using variables in the case of State Events

This sample demonstrates Supernova's "Knowledge Power" — the ability to use variables without prior declaration or initialization. Supernova automatically assigns sensible default values: when a variable is used in a multiplication expression, it defaults to 1 (so [x] x 5 = 5); when used in addition, it defaults to 0 (so [x] + 5 = 5). This forward-looking design eliminates the need for explicit variable declarations.

[1] KnowledgePower.nova
I want window 
The window title is Looking To The future.
I want listbox and the listbox top = 60.
window width = 700. and listbox width = 650.
The listbox must add item Supernova know that any variable may exist at any time in the future.
The listbox must add from [x].
The listbox must add item Supernova suggest that the initial [x] value is (1) when you write [x] x (5).
The listbox must add from [x] x (5).
The listbox must add item Supernova suggest that the initial [x] value is (0) when you write [x] + (5).
The listbox must add from [x] + (5).

This sample demonstrates Supernova's intelligent expression handling with multiplication. When the button is clicked, [x] is used without prior assignment in the expression [x] x (5). Supernova automatically initializes [x] to 1 for multiplication, so the first click yields 5, the second yields 25, and so on — each click multiplying the accumulated value by 5.

[2] ExpressionPower1.nova
I want window contains button
Button name is btn1. and button caption = Multiply.
The window title is Looking To The future.
 
I want listbox and the listbox top = 60.
 
Btn1 mouseclick. instructions are
:note: "Using [X] in the right side without 
        declaration and/or assigning a value to it.
        [x] automatically take the value of (1) because there are
        Multiply operation (x)"
 
        [x]. = [x] x (5).
        
        The listbox must add from [x].
 
End of instructions

This sample demonstrates Supernova's intelligent expression handling with division. The "(15). decimal places allowed" directive sets the decimal precision. When [x] is used without assignment in [x] / (5), Supernova initializes it to 1 for division, yielding 0.2 on the first click. Subsequent clicks continue dividing by 5, showcasing high-precision arithmetic.

[3] ExpressionPower2.nova
(15). decimal places allowed
 
I want window contains button
Button name is btn1. and button caption = Division.
The window title is Looking To The future.
 
I want listbox and the listbox top = 60.
 
Btn1 mouseclick. instructions are
:note: "Using [X] in the right side without 
        declaration and/or assigning a value to it.
        [x] automatically take the value of (1) because there are
        Division operation (/)"
 
        [x]. = [x] / (5).
        
        The listbox must add from [x].
 
End of instructions

This sample demonstrates Supernova's forward-looking event handling — you can define events for objects and variables that don't exist yet. The event handler for btn2 is written before btn2 is created, and state events for x=450 and x=600 are defined before [x] is ever used. When the button is clicked, [x] increments by 150, eventually triggering these pre-defined state events. This eliminates the need for top-down code ordering.

[4] EventsPower.nova
I want window contains button
Button name is btn1. and button caption = Create button.
The window title is Looking To The future.
Window width = 700.
 
:note: "Btn2 event before creating btn2 !!!"
Btn2 mouseclick. instructions are
        I want window and window title is wow.
End of instructions
 
:note: " x = 450 event before creating [x] !!!"
X 450. instructions are
        btn1. button selected
        The button caption is Close.
end of instructions
 
:note: " x = 600 event before creating [x] !!!"
X 600. instructions are you close application ok
 
Btn1 mouseclick. instructions are
:note: "Using [X] in the right side without 
        declaration and/or assigning a value to it.
        [x] automatically take the value of (0) because there are
        sum operation (+)"
 
        [x]. = [x] + (150).
 
        I want  button and the button name is btn2. 
        button left from [x].
 
End of instructions

GUI Reference

GUI

=====

The following reference block lists all available window-related commands in Supernova. This includes commands for setting the application title, creating and configuring windows (position, size, color, title), showing/hiding/closing windows, managing window parent-child relationships, and reading/writing window properties. The window events section lists all events that can be handled: move, gotfocus, lostfocus, mouseclick, mousemove, resize, maximize, minimize, and release.

code
Windows
---------
 
* Application title is ....data as value....
 
* You close application
 
* Do windows events
 
* Set window auto show on
 
* Set window auto show off
 
* Set window resize on
 
* Set window resize off
 
* Set window modal on
 
* Set window modal off
 
* I want window
 
* Window title is ....data as value....
 
* Window direction is right to left
 
* Window back color is ....data as value....
 
* Window top is ....data as value....
 
* Window left is ....data as value....
 
* Window width is ....data as value....
 
* Window height is ....data as value....
 
* You maximize window
 
* You minimize window
 
* You centre window
 
* You show window
 
* You hide window
 
* You close window
 
* Window name is ....data as value....
 
* ....data as value.... window selected
 
* Window parent is ....data as value....
 
* Window title from ....data as expression....
 
* Window title to ....data as expression....
 
* Window Handle to ....data as expression....
 
* Window top to ....data as expression....
 
* Window left to ....data as expression....
 
* Window Width to ....data as expression....
 
* Window Height to ....data as expression....
 
* Window top from ....data as expression....
 
* Window left from ....data as expression....
 
* Window Width from ....data as expression....
 
* Window Height from ....data as expression....
 
Window Events
---------------
 
        move
        gotfocus
        lostfocus
        mouseclick
        mousemove
        resize
        maximize
        minimize
        release

The following reference block lists all available GUI controls (widgets) in Supernova. The language provides 15 control types: Label, Textbox, Button, Editbox, Listbox, Combobox, Checkbox, Progressbar, Slider, Image, DatePicker, HyperLink, Spinner, Statusbar, and Menubar. Each control can be created, positioned, and styled using Supernova's natural language syntax.

code
Controls
----------
 
[1] Label
 
[2] Textbox
 
[3] Button
 
[4] Editbox
 
[5] Listbox
 
[6] Combobox
 
[7] Checkbox
 
[8] Progressbar
 
[9] Slider
 
[10] Image
 
[11] DatePicker
 
[12] HyperLink
 
[13] Spinner
 
[14] Statusbar
 
[15] Menubar

The following reference block documents all available Label control commands. Labels are static text display elements that support full styling (font name, size, bold, italic, underline, strikeout), color customization (foreground and background), positioning, transparency settings, and dynamic caption updates through expressions. Labels respond to the mouseclick event.

code
Label
-------
 
* I want label
 
* Label caption is ....data as value.... 
 
* Label top is ....data as value....
 
* Label left is ....data as value....
 
* Label width is ....data as value....
 
* Label height is ....data as value....
 
* Label name is ....data as value....
 
* Label font name is ....data as value....
 
* Label font size is ....data as value....
 
* Label fore color is ....data as value....
 
* Label back color is ....data as value....
 
* Label font bold is ....data as value....
 
* Label font italic is ....data as value....
 
* Label font underline is ....data as value....
 
* Label font strickout is ....data as value....
 
* Set label transparent on 
 
* Set label transparent off
 
* ....data as value.... label selected
 
* Label caption from ....data as expression....
 
* Label caption to ....data as expression....
 
* Label Top to ....data as expression....
 
* Label Left to ....data as expression....
 
* Label Width to ....data as expression....
 
* Label Height to ....data as expression....
 
* Label Top from ....data as expression....
 
* Label Left from ....data as expression....
 
* Label Width from ....data as expression....
 
* Label Height from ....data as expression....
 
Label Events
--------------
 
        mouseclick

The following reference block documents all available Textbox control commands. Textboxes are single-line text input fields that support font and color styling, positioning, and value read/write through expressions. Textboxes respond to gotfocus, lostfocus, change, and enter events, making them suitable for interactive forms.

code
Textbox
---------
 
* I want textbox
 
* Textbox value is ....data as value....
 
* Textbox top is ....data as value....
 
* Textbox left is ....data as value....
 
* Textbox width is ....data as value....
 
* Textbox height is ....data as value....
 
* Textbox name is ....data as value....
 
* Textbox font name is ....data as value....
 
* Textbox font size is ....data as value....
 
* Textbox fore color is ....data as value....
 
* Textbox back color is ....data as value....
 
* Textbox font bold is ....data as value.... 
 
* Textbox font italic is ....data as value....
 
* Textbox font underline is ....data as value....
 
* Textbox font strickout is ....data as value....
 
* ....data as value.... Textbox selected
 
* Textbox value from ....data as expression....
 
* Textbox value to ....data as expression....
 
Textbox Events
----------------
 
        gotfocus
        lostfocus
        change
        enter

The following reference block documents all available Button control commands. Buttons support caption text, full font and color styling, picture/image display, and dynamic property updates through expressions. Buttons respond to the mouseclick event, which is the primary interaction mechanism in Supernova applications.

code
Button
--------
 
* I want button
 
* Button caption is ....data as value....
 
* Button top is ....data as value....
 
* Button left is ....data as value....
 
* Button width is ....data as value....
 
* Button height is ....data as value....
 
* Button name is ....data as value....
 
* Button font name is ....data as value....
 
* Button font size is ....data as value....
 
* Button fore color is ....data as value....
 
* Button back color is ....data as value....
 
* Button font bold is ....data as value....
 
* Button font italic is ....data as value....
 
* Button font underline is ....data as value....
 
* Button font strickout is ....data as value....
 
* Button picture is ....data as value.... 
 
* ....data as value.... Button selected
 
* Button caption from ....data as expression....
 
* Button caption to ....data as expression....
 
* Button top to ....data as expression....
 
* Button left to ....data as expression....
 
* Button Width to ....data as expression....
 
* Button Height to ....data as expression....
 
* Button top from ....data as expression....
 
* Button left from ....data as expression....
 
* Button Width from ....data as expression....
 
* Button Height from ....data as expression....
 
Button Events
---------------
 
        mouseclick

The following reference block documents all available Editbox control commands. Editboxes are multi-line text editing areas (unlike single-line textboxes) that support font and color styling, positioning, and value read/write. Editboxes respond to gotfocus, lostfocus, and change events.

code
Editbox
---------
 
* I want editbox
 
* Editbox value is ....data as value....
 
* Editbox top is ....data as value....
 
* Editbox left is ....data as value....
 
* Editbox width is ....data as value....
 
* Editbox height is ....data as value....
 
* Editbox name is ....data as value....
 
* Editbox font name is ....data as value....
 
* Editbox font size is ....data as value....
 
* Editbox fore color is ....data as value....
 
* Editbox back color is ....data as value....
 
* Editbox font bold is ....data as value.... 
 
* Editbox font italic is ....data as value....
 
* Editbox font underline is ....data as value....
 
* Editbox font strickout is ....data as value....
 
* ....data as value.... Editbox selected
 
* Editbox value from ....data as expression....
 
* Editbox value to ....data as expression....
 
* Editbox Top to ....data as expression....
 
* Editbox Left to ....data as expression....
 
* Editbox Width to ....data as expression....
 
* Editbox Height to ....data as expression....
 
* Editbox Top from ....data as expression....
 
* Editbox Left from ....data as expression....
 
* Editbox Width from ....data as expression....
 
* Editbox Height from ....data as expression....
 
 
Editbox Events
----------------
 
        gotfoucs
        lostfoucs
        change

The following reference block documents all available Listbox control commands. Listboxes display scrollable lists of items and support adding items (both literal text and expression values), font and color styling, and value retrieval. Listboxes respond to gotfocus, lostfocus, change, and doubleclick events.

code
Listbox
---------
 
* I want listbox
 
* Listbox value is ....data as value....
 
* Listbox top is ....data as value....
 
* Listbox left is ....data as value....
 
* Listbox width is ....data as value....
 
* Listbox height is ....data as value....
 
* Listbox name is ....data as value....
 
* Listbox font name is ....data as value....
 
* Listbox font size is ....data as value.... 
 
* Listbox fore color is ....data as value....
 
* Listbox back color is ....data as value....
 
* Listbox font bold is ....data as value....
 
* Listbox font italic is ....data as value....
 
* Listbox font underline is ....data as value....
 
* Listbox font strickout is ....data as value....
 
* ....data as value.... Listbox selected
 
* Listbox must add item  ....data as value....
 
* Listbox must add from ....data as expression....
 
* Listbox value from ....data as expression....
 
* Listbox value to ....data as expression....
 
Listbox Events
----------------
 
        gotfoucs
        lostfocus
        change
        doubleclick

The following reference block documents all available Listbox control commands. Listboxes display scrollable lists of items and support adding items (both literal text and expression values), font and color styling, and value retrieval. Listboxes respond to gotfocus, lostfocus, change, and doubleclick events.

code
Listbox
---------
 
* I want listbox
 
* Listbox value is ....data as value....
 
* Listbox top is ....data as value....
 
* Listbox left is ....data as value....
 
* Listbox width is ....data as value....
 
* Listbox height is ....data as value....
 
* Listbox name is ....data as value....
 
* Listbox font name is ....data as value....
 
* Listbox font size is ....data as value.... 
 
* Listbox fore color is ....data as value....
 
* Listbox back color is ....data as value....
 
* Listbox font bold is ....data as value....
 
* Listbox font italic is ....data as value....
 
* Listbox font underline is ....data as value....
 
* Listbox font strickout is ....data as value....
 
* ....data as value.... Listbox selected
 
* Listbox must add item  ....data as value....
 
* Listbox must add from ....data as expression....
 
* Listbox value from ....data as expression....
 
* Listbox value to ....data as expression....
 
Listbox Events
----------------
 
        gotfoucs
        lostfocus
        change
        doubleclick

The following reference block documents all available Combobox control commands. Comboboxes combine a textbox with a dropdown list, allowing users to select from predefined options or type custom values. They support the same item management, styling, and value operations as listboxes, and respond to gotfocus, lostfocus, and change events.

code
Combobox
----------
 
* I want combobox
 
* Combobox value is ....data as value....
 
* Combobox top is  ....data as value....
 
* Combobox left is  ....data as value....
 
* Combobox width is  ....data as value....
 
* Combobox height is  ....data as value....
 
* Combobox name is  ....data as value....
 
* Combobox fontname is  ....data as value....
 
* Combobox fontsize is  ....data as value....
 
* Combobox forecolor is ....data as value....
 
* Combobox backcolor is ....data as value....
 
* Combobox fontbold is  ....data as value....
 
* Combobox fontitalic is  ....data as value....
 
* Combobox fontunderline is  ....data as value....
 
* Combobox fontstrickout is  ....data as value....
 
*  ....data as value.... Combobox selected
 
* Combobox must add item  ....data as value....
 
* Combobox must add from ....data as expression....
 
* Combobox value from ....data as expression....
 
* Combobox value to ....data as expression....
 
 
Combobox Events
-----------------
 
        gotfocus
        lostfocus
        change

The following reference block documents all available Checkbox control commands. Checkboxes are toggle controls that can be on (1) or off (0), with support for font and color styling. They respond to gotfocus, lostfocus, and change events, and their value can be set and read programmatically.

code
Checkbox
----------
 
* I want checkbox
 
* Checkbox value is ....data as value....
 
* Checkbox top is ....data as value....
 
* Checkbox left is ....data as value....
 
* Checkbox width is ....data as value.... 
 
* Checkbox height is ....data as value....
 
* Checkbox name is ....data as value....
 
* Checkbox font name is ....data as value....
 
* Checkbox font size is ....data as value....
 
* Checkbox fore color is ....data as value.... 
 
* Checkbox back color is ....data as value....
 
* Checkbox font bold is ....data as value.... 
 
* Checkbox font italic is ....data as value.... 
 
* Checkbox font underline is ....data as value....
 
* Checkbox font strickout is ....data as value.... 
 
* ....data as value.... Checkbox selected
 
* Checkbox caption is ....data as value....
 
Checkbox Events
-----------------
 
        gotfocus
        lostfocus
        change

Progressbar

* I want

progressbar

*

Progressbar value is ....data as value....

*

Progressbar top is ....data as value....

*

Progressbar left is ....data as value....

*

Progressbar width is ....data as value....

*

Progressbar height is ....data as value....

*

Progressbar name is ....data as value....

* ....data

as value.... Progressbar selected

*

Progressbar range minimum is ....data as value....

*

Progressbar range maximum is ....data as value....

*

Progressbar fore color is ....data as value....

*

Progressbar back color is ....data as value

The following reference block documents all available Slider control commands. Sliders allow users to select a numeric value by dragging a handle within a defined range. They support minimum and maximum range values, positioning, and respond to change and scroll events.

code
Slider
--------
 
* I want slider
 
* Slider value is ....data as value....
 
* Slider top is ....data as value....
 
* Slider left is ....data as value....
 
* Slider width is ....data as value....
 
* Slider height is ....data as value....
 
* Slider name is ....data as value.... 
 
* ....data as value.... slider selected
 
* Slider range minimum is ....data as value....
 
* Slider range maximum is ....data as value....
 
Slider Events
---------------
 
        change
        scroll

The following reference block documents all available Picture control commands. Picture controls display image files within the window, with configurable position and size. They respond to the mouseclick event, enabling clickable image areas.

code
Picture
---------
 
* I want picture
 
* Picture file is ....data as value....
 
* Picture top is  ....data as value....
 
* Picture left is  ....data as value....
 
* Picture width is  ....data as value....
 
* Picture height is  ....data as value....
 
* Picture name is  ....data as value....
 
* ....data as value.... Picture selected
 
Picture Events
----------------
 
        mouseclick

The following reference block documents all available DatePicker control commands. DatePickers provide a calendar-based date selection interface with full font and color styling. They respond to gotfocus, lostfocus, change, and enter events.

code
DatePicker
------------
 
* I want datepicker  
 
* Datepicker value is ....data as value....
 
* Datepicker top is  ....data as value....
 
* Datepicker left is  ....data as value....
 
* Datepicker width is  ....data as value....
 
* Datepicker height is  ....data as value....
 
* Datepicker name is  ....data as value.... 
 
* ....data as value.... datepicker selected
 
* Datepicker fore color is  ....data as value....
 
* Datepicker back color is  ....data as value....
 
* Datepicker font name is  ....data as value....
 
* Datepicker font size is  ....data as value....
 
* Datepicker font bold is  ....data as value....
 
* Datepicker font italic is  ....data as value....
 
* Datepicker font underline is  ....data as value....
 
* Datepicker font strickout is  ....data as value....
 
Datepicker Events
-------------------
 
        gotfocus
        lostfocus
        change
        enter

The following reference block documents all available HyperLink control commands. HyperLinks display clickable text that can navigate to a web address, with support for full font and color styling, transparency settings, and a configurable URL through the "address" property.

code
HyperLink
-----------
 
* I want hyperlink
 
* Hyperlink caption is ....data as value....
 
* Hyperlink top is ....data as value....
 
* Hyperlink left is ....data as value....
 
* Hyperlink width is ....data as value....
 
* Hyperlink height is ....data as value.... 
 
* Hyperlink name is ....data as value....
 
* Hyperlink font name is ....data as value....
 
* Hyperlink font size is ....data as value.... 
 
* Hyperlink fore color is ....data as value....
 
* Hyperlink back color is ....data as value....
 
* Hyperlink font bold is ....data as value....
 
* Hyperlink font italic is ....data as value....
 
* Hyperlink font underline is ....data as value....
 
* Hyperlink font strickout is ....data as value....
 
* Set hyperlink transparent on 
 
* Set hyperlink transparent off
 
* ....data as value.... hyperlink selected
 
* Hyperlink address is ....data as value....

The following reference block documents all available Spinner control commands. Spinners are numeric input controls with up/down arrows for incrementing and decrementing a value within a defined range. They support font and color styling and respond to gotfocus, lostfocus, and change events.

code
Spinner
---------
 
* I want spinner
 
* Spinner value is ....data as value....
 
* Spinner top is ....data as value....
 
* Spinner left is ....data as value....
 
* Spinner width is ....data as value....
 
* Spinner height is ....data as value....
 
* Spinner name is ....data as value....
 
* ....data as value.... Spinner selected 
 
* Spinner fore color is ....data as value....
 
* Spinner back color is ....data as value....
 
* Spinner font name is ....data as value....
 
* Spinner font size is ....data as value....
 
* Spinner font bold is ....data as value....
 
* Spinner font italic is ....data as value....
 
* Spinner font underline is ....data as value....
 
* Spinner font strickout is ....data as value....
 
* Spinner range minimum is ....data as value....
 
* Spinner range maximum is ....data as value....
 
Spinner Events
----------------
 
        gotfocus
        lostfocus
        change

The following reference block documents all available Statusbar control commands. Statusbars appear at the bottom of windows and can contain status items (custom text), a clock, a date display, and a keyboard indicator. They support font styling and provide a professional application footer.

code
Statusbar
-----------
 
* I want statusbar
 
* Statusbar font name is ....data as value....
 
* Statusbar font size is ....data as value....
 
* Statusbar font bold is ....data as value....
 
* Statusbar font italic is ....data as value.... 
 
* Statusbar font underline is ....data as value....
 
* Statusbar font strickout is ....data as value....
 
* I want status item
 
* I want status clock
 
* I want status date
 
* I want status keyboard
 
* Status item caption is ....data as value....
 
* Status item width is ....data as value....
 
* You show statusbar

The following reference block documents all available Menubar control commands. Menubars contain popup menus with menu items, providing a traditional application menu interface. Menu items have captions and names, and respond to the mouseclick event for triggering actions.

code
Menubar
---------
 
* I want menubar
 
* I want menu popup
 
* Menu popup caption is ....data as value....
 
* I want menu item
 
* Menu item caption is ....data as value....
 
* Menu item name is ....data as value....
 
Menu Item Events
------------------
 
        mouseclick

This sample demonstrates all available window events in Supernova. Two windows are created, and various events are attached to them: move, gotfocus, lostfocus, mouseclick, mousemove, resize, maximize, and minimize. Each event handler updates the window title to report which event was triggered, making this an interactive event reference and testing tool.

WindowEvents.nova
set window autoshow off
 
I want window and The Window Name is win1.
The window title is Just move me to see what will happen!.
Window top is 50. and window left is 50.
Window width is 350. and window height is 100.
The window back color is {55,155,205}. and you show window
 
I want window and The Window Name is win2.
The window title is Oh what will happen to me ?!.
The window back color is {255,205,175}.
Window top is 250. and window left is 250.
Window width is 350. and window height is 100. and You show window
 
win1 move. instructions are
        win1. window selected and The window title is "window is moved!!!."
        win2. window selected and The window backcolor is {0,0,0}.
        The window title is Oh no, i hate the BLACK color mmmmm.
end of instructions
 
win1 gotfocus. instructions are
        The window title is Wow i have the focus.
end of instructions
 
win1 lostfocus. instructions are
        The window title is Oh no i have lost the focus.
end of instructions
 
win1 mouseclick. instructions are
        The window title is WOw the window is Clicked!.
end of instructions
 
win1 mousemove. instructions are
        The window title is WOw the mouse is Moved!.
end of instructions
 
win1 resize. instructions are
        The window title is WOw the window is Resized!.
end of instructions
 
win2 maximize. instructions are
        The window title is Maximized!.
end of instructions
 
win2 minimize. instructions are
        The window title is Minimized!.
end of instructions

This sample demonstrates basic interaction between a label and a button control. Clicking the label changes the button's caption, and clicking the button changes the label's caption. This shows bidirectional communication between GUI controls through their respective mouse click events.

LabelButton.nova
I want window 
The window title is "Label and Button" and The window height is 100.
 
I want label and the label caption is "Label"
I want button and the button caption is "Button"
 
The label left is 50. and the button left is 250.
The label width is 200. and the button width is 200.
 
The label name is lbl1. and lbl1 mouseclick. instructions are
        The button caption is message form label click.
end of instructions
 
The button name is btn1. and btn1 mouseclick. instructions are
        The label caption is message form button click.
end of instructions

This sample demonstrates a label controlled by two buttons with styled formatting. The label uses custom font settings (Arial, bold, italic, underline, strikeout) and each button updates the label text to either "One" or "Two" when clicked. The window features a colored background, demonstrating Supernova's rich text and color formatting capabilities.

LabelTwoButtons.nova
Set window auto show off
 
I want window and the window title is "Label and two Buttons"
The window width is 250. and the window height is 200. 
The window backcolor is {100,200,250}.
 
I want button and the button caption is One (1).
The button top is 100. and the button left is 10.
The button width is 100. and the button height is 50.
The button name is btn1.
The button forecolor is {0,0,255}.
The button font bold is true.
 
I want button and the button caption is Two (2).
The button top is 100. and the button left is 130.
The button width is 100. and the button height is 50.
The button name is btn2.
The button forecolor is {0,0,255}.
The button font bold is true.
 
I want label and the label height is 40. 
the label top is 30. the label left is 70.
The label font name is arial. and the label font size is 30.
The label forecolor is {255,0,0}. and the label backcolor is {255,255,255}.
The label font bold is true.
The label font italic is true.
The label font under line is true.
The label font strick out is true.
 
You show window
 
btn1 mouseclick. instructions are
        The label caption is One.
end of instructions
 
btn2 mouseclick. instructions are
        The label caption is Two.
end of instructions

This sample demonstrates dynamic color changes using three buttons labeled "Red", "Green", and "Blue". Each button click changes the label's background color to the corresponding color. The third button also demonstrates the "label selected" command for switching between named controls. This is a practical example of runtime property modification.

LabelThreeButtons.nova
Set window auto show off
 
I want window and the window title is "Label and Three Buttons"
The window width is 370. and the window height is 200.
The window back color is {170,180,190}. 
 
I want label and the label height is 40. 
The label name is lbl1.
the label top is 30. the label left is 130.
The label font name is arial. and the label font size is 30.
The label backcolor is {0,255,0}.
The label font bold is true.
The label font italic is true.
The label font under line is true.
The label font strick out is true.
 
I want button and the button caption is Red.
The button top is 100. and the button left is 10.
The button width is 100. and the button height is 50.
The button name is btn1.
The button forecolor is {0,0,255}.
The button font bold is true.
 
I want button and the button caption is Green.
The button top is 100. and the button left is 130.
The button width is 100. and the button height is 50.
The button name is btn2.
The button forecolor is {0,0,255}.
The button font bold is true.
 
I want button and the button caption is Blue.
The button top is 100. and the button left is 250.
The button width is 100. and the button height is 50.
The button name is btn3.
The button forecolor is {0,0,255}.
The button font bold is true.
 
You show window
 
btn1 mouseclick. instructions are
the label backcolor is {255,0,0}.
end of instructions
 
btn2 mouseclick. instructions are
the label backcolor is {0,255,0}.
end of instructions
 
btn3 mouseclick. instructions are
lbl1. label selected
the label backcolor is {0,0,255}.
end of instructions

This sample demonstrates the checkbox control along with buttons that programmatically set its state. The checkbox is styled with custom fonts and colors, and two buttons ("On" and "Off") set the checkbox value to 1 or 0 respectively. This shows how to create and control checkbox controls in Supernova's GUI framework.

CheckboxTwoButtons.nova
set window auto show off
 
I want window and the window title is "checkbox"
The window back color is {100,40,200}.
The window width is 260.
The window height is 200.
 
I want checkbox and the checkbox name is mycheck.
The checkbox top is 50. and the checkbox left is 10.
The checkbox width is 200. and the checkbox height is 30.
The checkbox font name is "arial"
The checkbox font size is 14.
The checkbox forecolor is {255,255,255}.
The checkbox backcolor is {50,200,155}.
The checkbox caption is "Checkbox"
 
I want button and the button caption is On (1).
The button top is 100. and the button left is 10.
The button width is 100. and the button height is 50.
The button name is btn1.
The button forecolor is {0,0,255}.
The button font bold is true.
 
I want button and the button caption is Off (0).
The button top is 100. and the button left is 130.
The button width is 100. and the button height is 50.
The button name is btn2.
The button forecolor is {0,0,255}.
The button font bold is true.
 
You show window
 
btn1 mouseclick. instructions are
        The checkbox value is true.
end of instructions
 
btn2 mouseclick. instructions are
        The checkbox value is false.
end of instructions

The following reference block provides a color name lookup table for Supernova. Instead of specifying RGB values as {R,G,B} tuples, you can use named colors like "red", "blue", "green", etc. The table maps 17 color names to their RGB equivalents, making it easier to set foreground and background colors on any GUI control using natural language like "the label fore color is white" instead of "{255,255,255}".

code
Determine color by it's name
------------------------------
 
Example:-
 
        The label fore color is white.
        The label back color is red.
 
               Color           Value
        -------------------------------------------
               aqua           {0,255,255}
               black          {0,0,0}
               blue           {0,0,255}
               darkgray       {128,128,128}
               fuchsia        {255,0,255}
               gray           {128,128,128}
               green          {0,128,0}
               lime           {0,255,0}
               lightgray      {192,192,192}
               maroon          {128,0,0}
               navy           {0,0,128}
               purple         {128,0,128}
               red            {255,0,0}
               silver         {192,192,192}
               teal           {128,128,0}
               white          {255,255,255}
               yellow         {255,255,0}

The following sample demonstrates the use of named colors in practice. It creates a window with a blue background, a large "Welcome" label with white text on a blue background in a 50-point font, and a close button with purple text on a white background. This practical example shows how color names make the code more readable compared to using raw RGB values.

code
i want window and the window title is hello.
the window back color is blue.
the window width = 350. and the window height = 200.
 
i want label and the label caption is Welcome.
the label font size is 50.
the label width is 300. and the label height is 80.
the label fore color is white.
the label back color is blue.
 
i want button and the button caption is close.
the button top is 100. and the button left is 20.
the button width is 300. and the button name is btn1.
the button fore color is purple.
the button back color is white.
 
Btn1 MouseClick. instructions are
        You close window
end of instructions

This sample demonstrates window instance creation and reuse through named procedures. It creates a base maximized window and a child window initialized via the "mywin init" procedure. Each time the child window is clicked, a new instance is created with the same configuration, demonstrating how procedures enable repeatable object creation patterns.

WindowInstances.nova
set window auto show off 
 
i want window and the window name is basewin.
The window title is The main window. 
You maximize window and You show window
 
I want window and the window name is mywin.
mywin init. instructions must done and you show window
 
mywin init. instructions are
mywin. window selected
the window top is 50. and the window left is 50.
the window width is 200. and the window height is 200.
the window title is wow. and the window back color is {255,0,0}.
end of instructions
 
mywin mouseclick. instructions are 
I want window and the window name is mywin.
mywin init. instructions must done and you show window
end of instructions
 
mywin maximize. instructions are 
the window title is Maximize!!.
end of instructions

This sample demonstrates reusable textbox initialization using a shared procedure. Two textboxes are created, each initialized by calling "mytext init" which configures the font, size, and colors. The gotfocus and lostfocus events dynamically change the textbox colors to provide visual feedback, showing how a single event handler and initialization procedure can serve multiple control instances.

TextboxInstances.nova
I want window 
The window title is "Textbox"
The window width is 230. and the window height is 130.
 
I want textbox and mytext init. instructions must done
 
I want textbox and mytext init. instructions must done
The textbox top is 50.
 
mytext init. instructions are
The textbox name is mytext.
The textbox font name is "arial" 
The textbox font size is 14.
The textbox fore color is {0,0,255}.
The textbox back color is {100,255,100}.
end of instructions
 
mytext lostfocus. instructions are
        The textbox fore color is {50,100,150}.
        The textbox back color is {255,255,255}.
end of instructions
 
mytext gotfocus. instructions are
        The textbox fore color is {255,255,255}.
        The textbox back color is {50,100,150}.
end of instructions

This sample demonstrates reusable editbox configuration through a shared initialization procedure. Four editboxes are created in a grid layout, each initialized via "myeditbox init" which sets the name, font, and size. The change event handler dynamically updates colors when the user types, showcasing multi-instance control management with shared behavior.

EditboxInstances.nova
set window auto show off
 
I want window and the window title is "Editbox"
The window height is 520. and the window width is 440.
 
I want editbox and myeditbox init. instructions must done
the editbox backcolor is {100,200,250}.
the editbox value is "Welcome"
 
I want editbox and myeditbox init. instructions must done
the editbox left is 220.
the editbox value is "How r u ?"
 
I want editbox and myeditbox init. instructions must done
the editbox top is 220.
the editbox value is "Thank u"
 
I want editbox and myeditbox init. instructions must done
the editbox top is 220. and the editbox left is 220.
the editbox backcolor is {250,200,100}.
the editbox value is "I am fine !!"
 
I want button and the button top is 440.
The button height is 30. and the button width is 410.
The button caption is "Close"
The button name is mybtn.
 
you show window
 
mybtn mouseclick. instructions are
        you close window
end of instructions
 
myeditbox init. instructions are
        The editbox name is myeditbox.
        The editbox font name is "arial"
        The editbox font size is 14.
end of instructions
 
myeditbox change. instructions are
        The editbox back color is {50,100,150}.
        The editbox fore color is {255,255,255}.
end of instructions

This sample demonstrates reusable listbox creation with shared initialization and event handling. Three listboxes are created side by side, each populated with the same items via the "mylist init" procedure. The change, gotfocus, and lostfocus events provide visual feedback by changing colors, demonstrating how Supernova applies shared event handlers across multiple control instances.

ListboxInstances.nova
Set window auto show off
 
I want window and the window title is "Listbox"
The window width is 500.
The window height is 330.
 
I want label and the label top is 210.
The label width is 300. 
The label font name is "Arial" 
The label font size is 14.
 
I want button and the button caption is Close.
The button name is mybtn. and the button top is 250.
 
I want listbox and mylist init. instructions must done
 
I want listbox and mylist init. instructions must done
The listbox left is 230.
 
I want listbox and mylist init. instructions must done
The listbox left is 460.
 
You maximize window and you show window
 
mylist init. instructions are
The listbox name is mylist.
The listbox font name is "arial"
The listbox font size is 14.
The listbox must add item One   (1).
The listbox must add item Two   (2).
The listbox must add item Three (3).
The listbox must add item Four  (4).
The listbox must add item Five  (5).
The listbox value is 3.
end of instructions
 
mylist change. instructions are
        The label caption is "listbox value changed."
end of instructions
 
mylist gotfocus. instructions are
        The listbox forecolor is {255,255,255}.
        The listbox backcolor is {255,0,0}.
end of instructions
 
mylist lostfocus. instructions are
        The listbox forecolor is {0,0,0}.
        The listbox backcolor is {255,255,255}.
end of instructions
 
mybtn mouseclick. instructions are
        You close window
end of instructions

This sample creates a GUI application with interactive controls and event handlers. It demonstrates window creation, control placement and configuration, and user interaction through Supernova's natural language syntax.

ComboboxInstances.nova
Set window auto show off
 
I want window and the window title is "combobox"
The window width is 500.
The window height is 330.
 
I want label and the label top is 210.
The label width is 300. 
The label font name is "Arial" 
The label font size is 14.
 
I want button and the button caption is Close.
The button name is mybtn. and the button top is 250.
 
I want combobox and mycombo init. instructions must done
 
I want combobox and mycombo init. instructions must done
The combobox left is 230.
 
I want combobox and mycombo init. instructions must done
The combobox left is 460.
 
You maximize window and you show window
 
mycombo init. instructions are
The combobox name is mycombo.
The combobox width is 200.
The combobox height is 200.
The combobox font name is "arial"
The combobox font size is 14.
The combobox must add item One   (1).
The combobox must add item Two   (2).
The combobox must add item Three (3).
The combobox must add item Four  (4).
The combobox must add item Five  (5).
The combobox value is 3.
end of instructions
 
mycombo change. instructions are
        The label caption is "combobox value changed."
end of instructions
 
mycombo gotfocus. instructions are
        The combobox forecolor is {255,255,255}.
        The combobox backcolor is {255,0,0}.
end of instructions
 
mycombo lostfocus. instructions are
        The combobox forecolor is {0,0,0}.
        The combobox backcolor is {255,255,255}.
end of instructions
 
mybtn mouseclick. instructions are
        You close window
end of instructions

This sample demonstrates reusable checkbox configuration through a shared initialization procedure. Multiple checkboxes are created, each styled identically via the "mycheck init" procedure. The change, gotfocus, and lostfocus events provide interactive feedback, and a label reports when a checkbox value changes.

CheckboxInstances.nova
Set window auto show off
 
I want window and the window title is "checkbox"
The window width is 500.
The window height is 330.
 
I want label and the label top is 210.
The label width is 300. 
The label font name is "Arial" 
The label font size is 14.
 
I want button and the button caption is Close.
The button name is mybtn. and the button top is 250.
 
I want checkbox and mycheck init. instructions must done
 
I want checkbox and mycheck init. instructions must done
The checkbox left is 230.
 
I want checkbox and mycheck init. instructions must done
The checkbox left is 460.
 
You maximize window and you show window
 
mycheck init. instructions are
The checkbox name is mycheck.
The checkbox width is 200.
The checkbox height is 200.
The checkbox font name is "arial"
The checkbox font size is 14.
end of instructions
 
mycheck change. instructions are
        The label caption is "checkbox value changed."
end of instructions
 
mycheck gotfocus. instructions are
        The checkbox forecolor is {255,255,255}.
        The checkbox backcolor is {255,0,0}.
end of instructions
 
mycheck lostfocus. instructions are
        The checkbox forecolor is {0,0,0}.
        The checkbox backcolor is {255,255,255}.
end of instructions
 
mybtn mouseclick. instructions are
        You close window
end of instructions

File Operations

Files

Execute file ....data as value....

Execute from ....data as expression....

....data as expression.... memory to file ....data as expression....

....data as expression.... file to memory ....data as expression....

....data as expression.... file to open

....data as expression.... file to save

This sample demonstrates two ways to execute external files in Supernova. The "execute file" command runs a Supernova source file (welcome2.nova) by specifying its path as a literal value, while "execute from" opens any file type (like test.jpg) using the system's default application by evaluating the path as an expression. Two buttons trigger each method, showing both approaches to file execution.

ExecuteFile.nova
i want window and the window title is Execute file.
the window back color is {255,0,0}.
 
i want button and the button caption is Run "welcome2.nova"
the button top is 60. and the button left is 20.
the button width is 300. and the button name is btn1.
 
i want button and the button caption is Run "open test.jpg"
the button top is 100. and the button left is 20.
the button width is 300. and the button name is btn2.
 
Btn1 MouseClick. instructions are
        :note: " execute file command parameter is data as value"
        execute file "..\..\test\welcome2.nova"
end of instructions
 
Btn2 MouseClick. instructions are
        :note: " execute from command parameter is data as expression"
        execute from "(..\..\test\test.jpg)"
end of instructions

This sample demonstrates writing data from memory to a file using the "memory to file" command. When the button is clicked, a multi-line string containing a greeting message is stored in a variable and then written to "test.txt". This is Supernova's primary mechanism for creating and writing text files programmatically.

MemoryToFile.nova
i want window and the window title is memory to file.
the window back color is purple.
 
i want button and the button caption is Run "create test.txt"
the button top is 60. and the button left is 20.
the button width is 300. and the button name is btn1.
the button back color is white.
 
Btn1 MouseClick. instructions are
[mystr]. = "(Hello
How are you ?
I hope that you are fine.
bye.)"
[mystr]. memory to file "(test.txt)"
end of instructions

This sample demonstrates reading a file's contents into memory using the "file to memory" command. When the button is clicked, the entire contents of "test2.txt" are loaded into a variable, which is then displayed in an editbox. This is the complement to the "memory to file" command, enabling full file read/write operations.

FileToMemory.nova
i want window contains editBOX
the window title is file to memory.
the window back color is purple.
 
i want button and the button caption is Run "read test2.txt"
the button top is 260. and the button left is 20.
the button width is 300. and the button name is btn1.
the button back color is white.
 
Btn1 MouseClick. instructions are
        "(test2.txt)" file to memory [x].
        editbox value FROM [x].
end of instructions

This sample demonstrates advanced file reading with line-by-line parsing. After loading a file into memory, it iterates through each character using the Inside function, building up lines and detecting line endings. Each complete line is added to a listbox, effectively displaying the file contents with proper line breaks. This showcases how to process file data character by character in Supernova.

FileToMemory2.nova
i want window contains listbox
the window title is file to memory2.
the window back color is purple.
 
i want button and the button caption is Run "read test2.txt"
the button top is 260. and the button left is 20.
the button width is 300. and the button name is btn1.
the button back color is white.
 
Btn1 MouseClick. instructions are
"(test2.txt)" file to memory [x].
[lineend]. = (
).
        [mymax]. = len [x].
        [myline]. = .
        [y]. = (1). 
        do while [y] <= [mymax].
               [myadd]. = [y] inside [x].
               [myline]. = [myline] [myadd].
               [mycheck]. = (2) right [myline].
               do if  [mycheck] == [lineend] or [y] == [mymax].
                       listbox must add from [myline].                                      
                       [myline]. = .
               end if
               [y]. = [y] + (1).
        end while
end of instructions

This sample demonstrates the "file to open" command, which displays a standard Open File dialog. The user can browse and select a file, and the selected file path is stored in a variable and displayed as the window title. This provides a user-friendly way to get file paths at runtime.

FileToOpen.nova
i want window and the window title is file to open.
[x]. file to open
the window title from [x].

This sample demonstrates the "file to save" command, which displays a standard Save File dialog. The user can specify a filename and location, and the chosen path is stored in a variable and displayed as the window title. This is the counterpart to "file to open" for save operations.

FileToSave.nova
i want window and the window title is file to save.
[x]. file to save
the window title from [x].

This sample enhances the file open dialog with error handling. After the user selects (or cancels) the dialog, the code checks whether the returned path is empty. If no file was selected, it displays "no file selected"; otherwise, it shows the chosen file path. This demonstrates conditional logic for handling user cancellation of file dialogs.

FileToOpen2.nova
i want window and the window title is file to open2.
[x]. file to open
 
[check]. = [x] == ().
do if [check].
        the window title is no file selected.
end if
do if not [check].
        the window title from [x].
end if

Delivery Application

Delivery

Application

* Source code

* Distributing Application

* Delivery2 Source code

* What is new in Delivery2?

This sample is a complete delivery order management application that showcases Supernova's capability for building real-world business software. It features an array-based product catalog (Tea, Cafe, Sandwich), a searchable listbox, and an order generation system that creates a formatted delivery receipt with the current date, time, and selected item, saves it to a file, and opens it automatically. The search function performs case-insensitive substring matching across all products.

Delivery.nova
The application title is "Delivery"
Set window auto show off
Set window resize off
 
[myarray]. = (3).
[myarray]\(1). = (Tea).
[myarray]\(2). = (Cafe).
[myarray]\(3). = (Sandwich).
 
I want window and the window title is "Delivery"
Window width = 730. and window height = 530.
 
I want label 
The label width is 700. and label height is 120.
The label font size is 20. 
The label back color = white.
The label caption is 
"       
        What do you want ?
"
 
I want label and label top is 140.
label caption is Title :.
label font name is "arial"
label font size is "14"
 
I want textbox
textbox left is 80.
textbox top is 140.
textbox width is 500.
textbox font name is arial.
textbox font size is 14.
 
I want button
button top is 140.
button left is 600.
button caption is Search.
button font name is arial.
button font size is 14.
button name is BtnSearch.
 
I want listbox and listbox top is 180.
Listbox width is 700. and listbox height is 250.
The listbox font name is arial.
The listbox font size is 14.
 
[x]. = (1). and do while [x] <= [myarray].
The listbox must add from [myarray]\[x].
[x]. = [x] + (1).
end while
 
I want button and the button top is 450.
The button left is 240. and button caption = "Ok"
The button name is btn1.
The button back color is white.
 
I want button and the button top is 450.
The button left is 360. and button caption = "Close"
The button name is btnclose.
The button fore color is white.
The button back color is red.
btnclose mouseclick. instructions are you close application ok
 
listbox value is 1.
 
You centre window and You show window
 
btn1 mouseclick. instructions are
        The listbox value to [x].
        do if not [x] == (0).
               [myitem]. = [myarray]\[x].
               [mystr]. = "(
                       Delivery Application 
-------------------------------------------------------------------
Date  :) thedate  (
Time  :) thetime  (
Month :) themonth (
Day   :) theday   (
Item  :---------------> ) [myitem] (
-------------------------------------------------------------------)"
               [mystr]. memory to file "(delivery.txt)"
               execute file "delivery.txt"
        end if
end of instructions
 
btn search mouse click. instructions are
        textbox value to [mystr].
        [mystr]. = lower [mystr].
        [x]. = (1). 
        do while [x] <= [myarray].
               [myitem]. = lower [myarray]\[x].
               [check]. = [mystr] at [myitem].
               do if not [check] == (0).
                       listbox value from [x].
               end if
               [x]. = [x] + (1).
        end while
end of instructions

This is an enhanced version of the Delivery application with real-time interactive search. Instead of requiring a separate Search button click, the search executes automatically as the user types in the textbox (using the text1 change event). The report generation code is also streamlined, eliminating the intermediate variable and writing the formatted receipt directly to file. This demonstrates Supernova's ability to create responsive, event-driven data entry applications.

Delivery2.nova
The application title is "Delivery2"
Set window auto show off
Set window resize off
 
[myarray]. = (3).
[myarray]\(1). = (Tea).
[myarray]\(2). = (Cafe).
[myarray]\(3). = (Sandwich).
 
I want window and the window title is "Delivery"
Window width = 730. and window height = 530.
 
I want label 
The label width is 700. and label height is 120.
The label font size is 20. 
The label back color = white.
The label caption is 
"       
        What do you want ?
"
 
I want label and label top is 140.
label caption is Title :.
label font name is "arial"
label font size is "14"
 
I want textbox
textbox left is 80.
textbox top is 140.
textbox width is 500.
textbox font name is arial.
textbox font size is 14.
textbox name is text1.
 
I want listbox and listbox top is 180.
Listbox width is 700. and listbox height is 250.
The listbox font name is arial.
The listbox font size is 14.
 
[x]. = (1). and do while [x] <= [myarray].
The listbox must add from [myarray]\[x].
[x]. = [x] + (1).
end while
 
I want button and the button top is 450.
The button left is 240. and button caption = "Ok"
The button name is btn1.
The button back color is white.
 
I want button and the button top is 450.
The button left is 360. and button caption = "Close"
The button name is btnclose.
The button fore color is white.
The button back color is red.
btnclose mouseclick. instructions are you close application ok
 
listbox value is 1.
 
You centre window and You show window
 
btn1 mouseclick. instructions are
        The listbox value to [x].
        do if not [x] == (0).
               "(
                       Delivery Application 
-------------------------------------------------------------------
Date  :) thedate  (
Time  :) thetime  (
Month :) themonth (
Day   :) theday   (
Item  :---------------> ) [myarray]\[x] (
-------------------------------------------------------------------)"
               memory to file "(delivery.txt)"
               execute file "delivery.txt"
        end if
end of instructions
 
text1 change. instructions are
        textbox value to [mystr].
        [mystr]. = lower [mystr].
        [x]. = (1). 
        do while [x] <= [myarray].
               [myitem]. = lower [myarray]\[x].
               [check]. = [mystr] at [myitem].
               do if not [check] == (0).
                       listbox value from [x].
               end if
               [x]. = [x] + (1).
        end while
end of instructions

The following reference block highlights the improvements in Delivery2 over the original Delivery application. Two key changes were made: first, the search is now interactive (triggered by the textbox change event instead of requiring a Search button click), and second, the report generation code was streamlined by eliminating an intermediate variable and writing the formatted receipt directly to the file.

code
What is new in Delivery2.nova ?
 
1 - Interactive search (NO SEARCH BUTTON)
 
2 - Report Generation code changed  
    From :-
               [myitem]. = [myarray]\[x].
               [mystr]. = "(
                       Delivery Application 
-------------------------------------------------------------------
Date  :) thedate  (
Time  :) thetime  (
Month :) themonth (
Day   :) theday   (
Item  :---------------> ) [myitem] (
-------------------------------------------------------------------)"
               [mystr]. memory to file "(delivery.txt)"
 
   To :-
 
        "(
                       Delivery Application 
-------------------------------------------------------------------
Date  :) thedate  (
Time  :) thetime  (
Month :) themonth (
Day   :) theday   (
Item  :---------------> ) [myarray]\[x] (
-------------------------------------------------------------------)"
               memory to file "(delivery.txt)"

Language Extension (Call DLL Function)

Language

Extension (Call DLL Function)

....data as expression.... DLL library to use

....data as value.... DLL function to call with parameters ....data as

value....

With respect to DLL functions which return a value

The value will be stored in [Output] variable.

This sample demonstrates Supernova's language extension capability through DLL function calls. It calls the PlaySound function from winmm.dll to play a WAV audio file. The parameters are passed as a structured array where each element specifies the parameter type (string or number) and its value. This shows how Supernova can access any Windows API function through DLL interop.

CallDLL.nova
I want window 
The window title is "Call Dll - Play Sound , File Sample.wav"
 
[myarray]. = (3).
[myarray]\(1)\(1). = (string). [myarray]\(1)\(2). = "(sample.wav)"
[myarray]\(2)\(1). = (number). [myarray]\(2)\(2). = (0).
[myarray]\(3)\(1). = (number). [myarray]\(3)\(2). = (0).
"(winmm.dll)" Dll Library to use
"PlaySound" dll function to call with parameters "myarray"

The following reference block describes the Sound Player Library (SoundPlayerLib.nova), a reusable library that provides five procedures for audio playback: MySoundOpen (opens an audio file), MySoundPlay, MySoundPause, MySoundResume, and MySoundClose. The library wraps Windows multimedia DLL calls into simple, named procedures that can be called from any Supernova application.

code
Sound Player Library (SoundPlayerLib.nova)
--------------------------------------------
 
        1 - Source Code 
               1.1 - SoundPlayerLib.nova 
               1.2 - SoundPlayerLibDemo.nova
 
Sound Player Library procedures
---------------------------------
 
        * MySoundOpen  [input]. = "(filename.mp3)"
        * MySoundPlay
        * MySoundPause
        * MySoundResume
        * MySoundClose

This sample defines a reusable Sound Player Library with five procedures: MySoundOpen (opens an audio file), MySoundPlay (starts playback), MySoundPause (pauses playback), MySoundResume (resumes playback), and MySoundClose (closes the audio file). Each procedure constructs a parameter array and calls the mciSendString function from winmm.dll, which is the Windows Multimedia API for media control. This demonstrates how to build high-level library abstractions over low-level DLL calls.

SoundPlayerLib.nova
Procedure MySoundOpen.
[temparray]. = (4).
[temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(open ")[input](" type mpegvideo alias MediaFile)'
[temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(nil)'
[temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(0)'
[temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
"(winmm.dll)" Dll Library to use
"mciSendString" dll function to call with parameters "temparray"
end procedure
 
Procedure MySoundPlay.
 
[temparray]. = (4).
[temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(play MediaFile)'
[temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(nil)'
[temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(0)'
[temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
"(winmm.dll)" Dll Library to use
"mciSendString" dll function to call with parameters "temparray"
 
end procedure
 
Procedure MySoundPause.
 
[temparray]. = (4).
[temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(pause MediaFile)'
[temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(nil)'
[temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(0)'
[temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
"(winmm.dll)" Dll Library to use
"mciSendString" dll function to call with parameters "temparray"
 
end procedure
 
Procedure MySoundClose.
 
[temparray]. = (4).
[temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(close MediaFile)'
[temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(nil)'
[temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(0)'
[temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
"(winmm.dll)" Dll Library to use
"mciSendString" dll function to call with parameters "temparray"
 
end procedure
 
Procedure MySoundResume.
 
[temparray]. = (4).
[temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(resume MediaFile)'
[temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(nil)'
[temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(0)'
[temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
"(winmm.dll)" Dll Library to use
"mciSendString" dll function to call with parameters "temparray"
 
end procedure

This sample demonstrates how to use the Sound Player Library in a practical application. It includes the library via "do file", creates a window with Play, Pause, Resume, and Close buttons, and each button calls the corresponding library procedure with appropriate parameters. This shows the clean separation between library code and application code in Supernova.

SoundPlayerLibDemo.nova
Application title is Sound Player Library Demo. 
 
do file "SoundPlayerLib.nova"
 
I want window 
The window title is "Sound Player Library Demo"
 
i want button and button caption is "open test.mp3" and button top is 50.
button name is btn1.
 
i want button and button caption is play. and button top is 100.
button name is btn2.
 
i want button and button caption is pause. and button top is 150.
button name is btn3.
 
i want button and button caption is resume. and button top is 200.
button name is btn4.
 
i want button and button caption is close. and button top is 250.
button name is btn5.
 
btn1 mouse click. instructions are
        [input]. = "(test.mp3)" and do procedure MySoundOpen.
end of instructions
 
btn2 mouse click. instructions are
        do procedure MySoundPlay.
end of instructions
 
btn3 mouse click. instructions are
        do procedure MySoundPause.
end of instructions
 
btn4 mouse click. instructions are
        do procedure MySoundResume.
end of instructions
 
btn5 mouse click. instructions are
        do procedure MySoundClose.
end of instructions

The following reference block describes the Sound Recorder Library (SoundRecorderLib.nova), which provides procedures for audio recording: MySoundRecord (starts recording from the microphone) and MySoundSave (saves the recording to a WAV file). Like the Sound Player Library, it wraps Windows multimedia API calls into easy-to-use Supernova procedures.

code
Sound Recorder Library (SoundRecorderLib.nova)
------------------------------------------------
 
        1 - Source Code 
               1.1 - SoundRecorderLib.nova 
               1.2 - SoundRecorderLibDemo.nova
 
Sound Recorder Library procedures
-----------------------------------
 
        * MySoundRecord
        * MySoundSave  [input]. = "(filename.wav)"

This sample defines a Sound Recorder Library that extends Supernova's capabilities to record audio. It provides MySoundRecord (starts recording) and MySoundSave (saves the recording to a WAV file) procedures, both using the mciSendString Windows API through DLL calls. The recording uses the "waveaudio" device type for capturing microphone input.

SoundRecorderLib.nova
Procedure MySoundrecord.
 
        "(winmm.dll)" Dll Library to use
 
        [temparray]. = (4).
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(open new Type waveaudio Alias recsound)'
        [temparray]\(2)\(1). = (string). [temparray]\(2)\(2). = '()'
        [temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(0)'
        [temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
        "mciSendString" dll function to call with parameters "temparray"
 
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(record recsound)'
        "mciSendString" dll function to call with parameters "temparray"
 
End procedure
 
Procedure MySoundSave.
 
        "(winmm.dll)" Dll Library to use
 
        [temparray]. = (4).
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(save recsound ) [input]'
        [temparray]\(2)\(1). = (string). [temparray]\(2)\(2). = '()'
        [temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(0)'
        [temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
        "mciSendString" dll function to call with parameters "temparray"
 
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(close recsound)'
        "mciSendString" dll function to call with parameters "temparray"
 
End procedure

This sample demonstrates how to use the Sound Recorder Library. It provides a simple interface with two buttons: "Record" starts audio capture, and "Save to test.wav" saves the recorded audio to a file. The application includes the library file and calls its procedures, showcasing how recorded audio functionality can be integrated into Supernova applications.

SoundRecorderLibDemo.nova
Application title is Sound Recorder Library Demo. 
 
do file "SoundRecorderLib.nova"
 
I want window 
The window title is "Sound Recorder Library Demo"
 
i want button and button caption is "Record" and button top is 50.
button name is btn1.
 
btn1 mouse click. instructions are
        do procedure MySoundRecord.
end of instructions
 
i want button and button caption is "Save to test.wav" and button top is 100.
button name is btn2.
 
btn2 mouse click. instructions are
        [input]. = "(test.wav)" do procedure MySoundSave.
end of instructions

The following reference block describes the Movie Player Library (MoviePlayerLib.nova), which provides five procedures for video playback: MyMovieOpen (opens an AVI file attached to a window), MyMoviePlay (plays with a specified region), MyMoviePause, MyMovieResume, and MyMovieClose. The library parameters include the filename, an alias for the media, and the parent window handle for embedded playback.

code
Movie Player Library (MoviePlayerLib.nova)
--------------------------------------------
 
        1 - Source Code 
               1.1 - MoviePlayerLib.nova 
               1.2 - MoviePlayerLibDemo.nova
 
Movie Player Library procedures
---------------------------------
 
        * MyMovieOpen  
               [input] : filename.avi
               [input2]: Alias  , MyMovie for example
                [input3]: window handle , use command (Window handle to)
        * MyMoviePlay
               [input] : Alias
               [input2] : Movie region as : left top width height
        * MyMoviePause
               [input] : Alias
        * MyMovieResume
               [input] : Alias , MyMovie for example
        * MyMovieClose 
               [input] : Alias , MyMovie for example

This sample defines a comprehensive Movie Player Library with five procedures for video playback: MyMovieOpen (opens an AVI file and attaches it to a window), MyMoviePlay (plays the video in a specified region), MyMoviePause, MyMovieResume, and MyMovieClose. It uses the mciSendString API to control AVI video playback, including setting the video as a child window of the application for embedded playback.

MoviePlayerLib.nova
Procedure MyMovieOpen.
 
        :note: " [input] = filename.avi  [input2] = Alias  [input3] = window handle"
 
        "(winmm.dll)" Dll Library to use
 
        [temparray]. = (4).
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(open ")[input](" type AVIvideo  alias ) [input2] ( style child parent ) [input3]'
        [temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(0)'
        [temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(128)'
        [temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
        "mciSendString" dll function to call with parameters "temparray"
 
end procedure
 
Procedure MyMoviePlay.
 
        :note: " [input] = Alias  [input2] = movie region entered as left top width height"
 
        "(winmm.dll)" Dll Library to use
 
        [temparray]. = (4).
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(put ) [input] ( window client at ) [input2]'
        [temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(0)'
        [temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(128)'
        [temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
        "mciSendString" dll function to call with parameters "temparray"
 
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(play ) [input]'
        "mciSendString" dll function to call with parameters "temparray"
 
End procedure
 
Procedure MyMoviePause.
 
        :note: " [input] = Alias "
 
        "(winmm.dll)" Dll Library to use
 
        [temparray]. = (4).
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(pause ) [input]'
        [temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(0)'
        [temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(128)'
        [temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
        "mciSendString" dll function to call with parameters "temparray"
 
End procedure
 
Procedure MyMovieResume.
 
        :note: " [input] = Alias "
 
        "(winmm.dll)" Dll Library to use
 
        [temparray]. = (4).
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(resume ) [input]'
        [temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(0)'
        [temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(128)'
        [temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
        "mciSendString" dll function to call with parameters "temparray"
 
 
End procedure
 
Procedure MyMovieClose.
 
        :note: " [input] = Alias "
 
        "(winmm.dll)" Dll Library to use
 
        [temparray]. = (4).
        [temparray]\(1)\(1). = (string). [temparray]\(1)\(2). = '(close ) [input]'
        [temparray]\(2)\(1). = (number). [temparray]\(2)\(2). = '(0)'
        [temparray]\(3)\(1). = (number). [temparray]\(3)\(2). = '(128)'
        [temparray]\(4)\(1). = (number). [temparray]\(4)\(2). = '(0)'
 
        "mciSendString" dll function to call with parameters "temparray"
 
End procedure

This sample demonstrates the Movie Player Library in action. It creates a window with five buttons for complete video control: open, play, pause, resume, and close. The open button configures the video file, alias, and parent window handle, while the play button specifies the video display region within the window. This showcases embedded video playback capabilities in a Supernova application.

MoviePlayerLibDemo.nova
Application title is Movie Player Library Demo. 
 
do file "MoviePlayerLib.nova"
 
I want window and window back color is white. and window width is 700.
The window title is "Movie Player Library Demo"
 
i want button and button caption is "open test.avi" and button top is 50.
button name is btn1.
 
i want button and button caption is play. and button top is 100.
button name is btn2.
 
i want button and button caption is pause. and button top is 150.
button name is btn3.
 
i want button and button caption is resume. and button top is 200.
button name is btn4.
 
i want button and button caption is close. and button top is 250.
button name is btn5.
 
btn1 mouse click. instructions are
        [input]. = "(test.avi)"
        [input2]. = (mymovie).
        window handle to [input3].
        do procedure MyMovieOpen.
end of instructions
 
btn2 mouse click. instructions are
        [input]. = (mymovie).
        [input2]. = (150 10 400 300).
        do procedure MyMoviePlay.
end of instructions
 
btn3 mouse click. instructions are
        [input]. = (mymovie). and do procedure MyMoviePause.
end of instructions
 
btn4 mouse click. instructions are
        [input]. = (mymovie). and do procedure MyMovieResume.
end of instructions
 
btn5 mouse click. instructions are
        [input]. = (mymovie). and do procedure MyMovieClose.
end of instructions

Component Object Model (COM)

* ....data as expression.... COM Object to create of type ....data as expression....

* ....data as expression.... COM Object to use

* ....data as expression.... COM Property to set ....data as expression....

* ....data as expression.... COM Property to get ....data as expression....

* ....data as expression.... COM Method to call with parameters ....data as value....

This sample demonstrates Supernova's COM (Component Object Model) integration for automating external applications. It creates a Word.Application COM object, adds a new document, and controls its visibility using COM property manipulation. Three buttons allow the user to open Word, hide it, and show it again. This demonstrates how Supernova can automate any COM-compatible application on Windows.

COM_Test.nova
I want window and the window title is COM Test.
I want button and button caption is Open Word Application. button width = 150.
button name = btn1.
I want button and button caption is Hide Word.
button name = btn2. and button left = 200.
I want button and button caption is Show Word.
button name = btn3. and button left = 350.
procedure btn1 mouse click.
[myobj]. COM Object to create of type "(Word.Application)"
[myobj]. COM Object to use
"(Documents:Add)" COM method to call with parameters nothing.
(visible). COM Property to set (1).
endprocedure
procedure btn2 mouse click.
[myobj]. COM Object to use and (visible). COM Property to set (0).
endprocedure
procedure btn3 mouse click.
[myobj]. COM Object to use and (visible). COM Property to set (1).
endprocedure

ADODB Sample

This sample demonstrates database access through ADODB COM objects — a complete database CRUD (Create, Read, Update, Delete) example. It connects to a Microsoft Access database (test.mdb) using an ADODB Connection, opens a recordset with SQL, deletes existing records, inserts 10 new records (each with a number and its square), and displays all records in a listbox. This is one of the most advanced samples, showcasing Supernova's ability to build data-driven applications using COM database connectivity.

ADODB_Test.nova
I want window contains LISTBOX and the window title is Using ADODB.
Window width = 600.  and WINDOW HEIGHT = 500.
Window back color is white.
Listbox width = 350. and LISTBOX HEIGHT = 450.
Listbox back color is silver.
Listbox fore color is Black.
Listbox font name is arial.
Listbox font size is 14.
I want button and button caption is Test ADODB.
Button name = btn1. and button LEFT = 400. and button width = 150.
procedure btn1 mouse click.
:Note: " Connect to the
Database Test.MDB"
[MYCON]. COM OBJECT TO CREATE OF TYPE "(ADODB.Connection)"
[MYCON]. COM Object to use
[MYARRAY]. = (1).
[MYARRAY]\(1)\(1). = (string).
[MYARRAY]\(1)\(2). = '(Provider=MSDASQL.1;Persist
Security Info=False;Extended Properties="dsn=MS Access
Database;uid=";Initial Catalog=test.mdb)'
"(OPEN)" COM method to call with parameters MYARRAY.
:Note: " Open Table
MainTable"
[MYRS]. COM OBJECT TO CREATE OF TYPE "(ADODB.Recordset)"
[MYRS]. COM Object to use
(CursorType). COM Property to set (3).
(LockType). COM Property to set (3).
(ActiveConnection). COM Property to set [MYCON].
[MYARRAY]. = (1).
[MYARRAY]\(1)\(1). = (String).
[MYARRAY]\(1)\(2). = '(Select *
from MainTable)'
"(OPEN)" COM method to call with parameters MYARRAY.
:Note: " Delete All
Records"
'(RECORDCOUNT)' COM PROPERTY TO GET [MYMAX].
doif [mymax] > (0).
[X]. = (1).
DoWhile [x] <= [MYMAX].
"(movefirst)" COM method to call with parameters .
"(delete)" COM method to call with parameters .
"(update)" COM method to call with parameters .
[x]. = [x] + (1).
endwhile
endif
:Note: " Add 10 Records
"
[X]. = (1).
DoWhile [x] <= (10).
"(AddNew)" com method to call with parameters .
'|fields:item("Number"):value|' COM PROPERTY TO SET [x].
'|fields:item("Square"):value|' COM PROPERTY TO SET [x] x [x].
"(UPDATE)" COM method to call with parameters .
[x]. = [x] + (1).
EndWhile
:Note: " Show All Records
"
"(movefirst)" COM method to call with parameters .
'(RECORDCOUNT)' COM PROPERTY TO GET [MYMAX].
listbox must add item --------------------------.
listbox must add from (Records
Count = ) [MYMAX].
listbox must add item --------------------------.
listbox must add item
Number
Square.
listbox must add item --------------------------.
[X]. = (1).
DoWhile [x] <= [MYMAX].
'|fields:item("Number"):value|' COM PROPERTY TO GET [V1].
'|fields:item("Square"):value|' COM PROPERTY TO GET [V2].
Listbox must add from [v1] (
)
[v2].
"(movenext)" COM method to call with parameters .
[x]. = [x] + (1).
EndWhile
:Note: " Close Recordset"
"(CLOSE)" COM method to call with parameters .
:Note: " Close Connection"
[MYCON]. COM Object to use and "(CLOSE)" COM method to call with parameters .
endprocedure

Language Details

This section covers performance characteristics, error messages, and language grammar.

Performance Architecture

Supernova was developed using HarbourPWCT (Programming Without Coding Technology). Harbour uses a Compiler + VM and Supernova Interpreter is based on hybrid implementation.

----------------------------
Supernova Application
----------------------------
Supernova Compiler || Supernova Interpreter
Supernova VM      || (Hybrid Implementation)
----------------------------
Harbour VM
----------------------------

When you run a Supernova Application you run a Compiler + 2 Virtual Machines.

Language Features Affecting Performance:

2.1) Source code not Case/Space/Line/Tab Sensitive

2.2) No Need for Variable/Array declaration

2.3) No Need for initial variable value before using it

2.4) No Variable type

2.5) Support for Events Based on variable value (State Events)

2.6) Multi-Language Source Code Support (Arabic/English/Mixed)

Performance Samples

This performance benchmark sample tests Supernova's speed by iterating through a loop 100 times, computing the square of each number and storing it in an array. It measures the elapsed time using the "the seconds" function before and after the loop, displaying both the final array value and the execution time. This provides a baseline performance measurement for small data sets.

[1] Performance_LoopArray100.nova
i want window and the window title is Loop Array 100.
 
[mytime1]. = the seconds.
 
[x]. = (1). and do while [x] <= (100).
                       [myarray]\[x]. = [x] x [x].
                       [x]. = [x] + (1).
                       do windows events
               end while
 
i want textbox AND the textbox value from [myarray]\(100).
 
[mytime2]. = the seconds.
 
i want textbox and the textbox value from [mytime2]-[mytime1].
 
the textbox top is 50.

This performance benchmark extends the loop test to 1,000 iterations, measuring how Supernova scales with 10 times more data. Like the 100-element version, it computes squares and stores them in an array while tracking execution time, allowing developers to compare performance across different problem sizes.

[2] Performance_LoopArray1000.nova
i want window and the window title is Loop Array 1,000.
 
[mytime1]. = the seconds.
 
[x]. = (1). and do while [x] <= (1000).
                       [myarray]\[x]. = [x] x [x].
                       [x]. = [x] + (1).
                       do windows events
               end while
 
i want textbox and the textbox value from [myarray]\(1000).
 
[mytime2]. = the seconds.
 
i want textbox and the textbox value from [mytime2]-[mytime1].
 
the textbox top is 50.

This performance benchmark pushes the loop test to 10,000 iterations, providing a meaningful stress test for Supernova's array operations and loop execution speed. The elapsed time measurement helps developers understand the language's performance characteristics with larger data sets.

[3] Performance_LoopArray10000.nova
i want window and the window title is Loop Array 10,000.
 
[mytime1]. = the seconds.
 
[x]. = (1). and do while [x] <= (10000).
                       [myarray]\[x]. = [x] x [x]. 
                       [x]. = [x] + (1).
                       do windows events
               end while
 
i want textbox and the textbox value from [myarray]\(10000).
 
[mytime2]. = the seconds.
 
i want textbox and the textbox value from [mytime2]-[mytime1].
 
the textbox top is 50.

This sample creates a GUI window and configures its properties using Supernova's natural language statements. It demonstrates how to set up visual elements and their attributes declaratively.

[4] Performance_LoopArray100000.nova
i want window and the window title is Loop Array 100,000.
 
[mytime1]. = the seconds.
 
[x]. = (1). and do while [x] <= (100000).
                       [myarray]\[x]. = [x] x [x]. 
                       [x]. = [x] + (1).
                       do windows events
               end while
 
i want textbox and the textbox value from [myarray]\(100000).
 
[mytime2]. = the seconds.
 
i want textbox and the textbox value from [mytime2]-[mytime1].
 
the textbox top is 50.

This sample creates a GUI window and configures its properties using Supernova's natural language statements. It demonstrates how to set up visual elements and their attributes declaratively.

[5] Performance_LoopArray1000000.nova
i want window and the window title is Loop Array 1,000,000.
 
[mytime1]. = the seconds.
 
[x]. = (1). and do while [x] <= (1000000).
                       [myarray]\[x]. = [x] x [x]. 
                       [x]. = [x] + (1).
                       do windows events
               end while
 
i want textbox and the textbox value from [myarray]\(1000000).
 
[mytime2]. = the seconds.
 
i want textbox and the textbox value from [mytime2]-[mytime1].
 
the textbox top is 50.

This sample creates a GUI window and configures its properties using Supernova's natural language statements. It demonstrates how to set up visual elements and their attributes declaratively.

[6] Performance_Loop10000.nova
i want window and the window title is Loop10000.
 
[mytime1]. = the seconds.
 
[x]. = (1). and do while [x] <= (10000).
                       [Y]. = [X] x [X]. 
                       [x]. = [x] + (1).
                       do windows events
               end while
 
i want textbox and the textbox value from [Y].
 
[mytime2]. = the seconds.
 
i want textbox and the textbox value from [mytime2]-[mytime1].
 
the textbox top is 50.

The following reference block lists all error messages that the Supernova compiler and interpreter can produce. There are 14 distinct error types, ranging from structural errors (unclosed or unexpected IF/While/Function statements) to expression errors (missing variables, values, or operators), GUI errors (no window or object defined), and general syntax errors. Each error includes a number and descriptive message to help developers identify and fix issues in their code.

code
Error Messages
----------------
 
   1) : Unexpected End IF Statement - Do IF Statement is required.
   2) : Unclosed Do IF Statement structure- End IF Statement is required.
   3) : Unexpected End While Statement - Do While Statement is required.
   4) : Unclosed Do While Statement structure- End While Statement is required.
   5) : General Syntax Error.
   6) : Command Error, The Grammer is TRUE but the Command is undefined.
   7) : Expression Error [Variable] is expected.
   8) : Expression Error (Value) is expected.
   9) : General Expression Error.
  10) : Expression Error, Cann't determine expression result.
  11) : Bad GUI Command (No Window Defined).
  12) : Bad GUI Command (No Object Defined).
  13) : Unexpected OK/End Function/End Procedure/End Of Instructions Statement
  14) : Unclosed Procedure/.....Instructions Are/Function Statement structure

This error demonstration sample intentionally creates multiple unclosed "DO IF" statements without matching "endif" closers. When run, Supernova's compiler detects the structural mismatch and reports an "Unclosed Do IF Statement" error, showing how the language handles missing block terminators.

[1] ManyUnclosedIF.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
[X]. = (1).
 
DO IF [X] = (1).
DO IF [X] = (1).
DO IF [X] = (1).
endif
DO IF [X] = (1).
DO IF [X] = (1).

This error demonstration sample contains multiple "endif" statements without corresponding "DO IF" openers. Supernova detects these orphaned block terminators and reports "Unexpected End IF Statement" errors, demonstrating the compiler's ability to catch mismatched control structure boundaries.

[2] ManyUnexpectedEndif.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
 
endif
endif
 
do if [x] = (1).
endif
 
endif
endif

This error sample combines both error types: an unexpected "endif" appears before a "do if" that is never closed. This tests Supernova's error detection when multiple types of structural errors coexist in the same program.

[3] MixUnexpectedEndifUnclosedIF.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
 
endif
do if [x] = (1).

This error sample demonstrates the simplest case of an unclosed conditional: a single "DO IF" statement with no matching "endif". The compiler reports this as an unclosed structure error at the end of the program.

[4] UnclosedIF.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
[X]. = (1).
DO IF [X] = (1).

This error sample demonstrates the simplest case of an orphaned block terminator: a single "endif" statement with no preceding "DO IF". The compiler immediately reports this as an unexpected statement.

[5] UnexpectedEndif.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
 
endif

This error sample mirrors the IF error tests but for while loops, creating multiple "DO While" statements without enough matching "endWhile" closers. The compiler detects the unclosed loop structures and reports appropriate errors.

[6] ManyUnclosedWhile.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
[X]. = (1).
 
DO While [X] = (1).
DO While [X] = (1).
DO While [X] = (1).
endWhile
DO While [X] = (1).
DO While [X] = (1).

This error sample contains multiple "endWhile" statements without corresponding "DO While" openers, testing the compiler's detection of orphaned loop terminators.

[7] ManyUnexpectedEndWhile.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
 
endWhile
endWhile
 
do While [x] = (1).
endWhile
 
endWhile
endWhile

This error sample combines an unexpected "endwhile" followed by an unclosed "do while", testing the compiler's handling of mixed loop structure errors.

[8] MixUnexpectedEndWhileUnclosedWhile.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
 
endwhile
do while [x] = (1).

This error sample demonstrates the simplest unclosed loop error: a single "DO While" with no matching "endWhile". The compiler reports this structural error when it reaches the end of the program.

[9] UnclosedWhile.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
[X]. = (1).
DO While [X] = (1).

This error sample demonstrates a single orphaned "endwhile" statement with no preceding loop, triggering an unexpected statement error.

[10] UnexpectedEndWhile.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
 
endwhile

This error sample triggers a general syntax error by including the word "what" — a token that doesn't fit any valid grammar rule. Since "what" is not recognized as a Pronoun, Verb, Class, Instruction, or any other token type, the compiler reports Error #5: General Syntax Error.

[11] GeneralSyntaxError.nova
Application title = Error.
 
I want window and window title = Error.
 
what

This error sample demonstrates Error #6: the grammar is syntactically correct ("You show listbox" follows the PVC rule) but the command is undefined — there is no "show listbox" command in Supernova. This shows the difference between grammatical correctness and semantic validity.

[12] CommandError.nova
Application title = Error.
 
I want window and window title = Error.
 
You show listbox

This error sample demonstrates Error #7 (Expression Error, Variable expected) by using a malformed variable reference "[x." — the closing bracket is missing, making it an invalid variable expression.

[13] DataExpr1.nova
Application title = Error.
 
I want window and window title from [x.

This error sample demonstrates Error #8 (Expression Error, Value expected) by using a malformed literal value "(5." — the closing parenthesis is missing, making it an invalid value expression.

[14] DataExpr2.nova
Application title = Error.
 
I want window and window title from (5.

This error sample demonstrates Error #9 (General Expression Error) by using "wow" as an expression without proper variable brackets or value parentheses. The compiler cannot determine what kind of data this represents.

[15] DataExpr3.nova
Application title = Error.
 
I want window and window title from wow.

This error sample demonstrates Error #10 (Cannot determine expression result) by writing an expression that starts with an operator "+ (5)". Since there is no left operand before the plus sign, the expression cannot be evaluated.

[16] DataExpr4.nova
Application title = Error.
 
I want window and window title from + (5).

This error sample demonstrates a runtime division-by-zero error by attempting to compute (100) / (0). This triggers a mathematical error that the interpreter catches and reports.

[17] DividebyZero.nova
Application title = Error.
 
I want window and window title from (100) / (0).

This error sample demonstrates Error #11 (Bad GUI Command, No Window Defined) by trying to set a window title without first creating a window with "I want window". GUI property commands require an active window context.

[18] NoWindowDefined.nova
the window title is wow.

This error sample demonstrates Error #12 (Bad GUI Command, No Object Defined) by trying to set a button caption after creating a window but without creating a button first. The window exists, but no button object has been defined.

[19] NoObjectDefined.nova
i want window
the button caption is wow.

This error sample demonstrates Error #11 by trying to set a textbox value without any window or textbox being created first. Neither a window nor an object context exists.

[20] NoWindowDefinedNoObjectDefined.nova
the textbox value is wow.

This error sample demonstrates Error #13 (Unexpected End of Instructions) by placing an "end of instructions" statement without a matching opening block like a procedure, function, or event handler.

[21] UnexpectedEndFunction.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
end of instructions

This error sample demonstrates Error #14 by declaring a function ("function wow.") at an invalid location or with an unclosed structure, testing the compiler's function structure validation.

[22] UnexpectedFunction.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
function wow.

This error sample combines an unexpected "End function" followed by an orphaned "function wow." declaration, testing the compiler's ability to detect and report multiple function structure errors in sequence.

[23] MixUnexpectedEndFunctionUnexpectedFunction.nova
Application title = Error.
 
I want window and window title = Error.
Window height = 130.
 
End function
 
function wow.

The following reference block formally defines Supernova's complete grammar specification. It documents the token classification system where each token is a single character classified into one of seven categories (S, P, V, C, I, A, D), explains that the grammar is context-sensitive rather than context-free, and lists the production rules along with the context switching table that determines which token classes can follow each other.

code
Supernova Programming Language Grammar
----------------------------------------
 
* The Language is not Case/Space/Line/Tab sensitive
* The Token is a one character (Letter/Number/....etc). 
* The Grammer is ***Context Sensitive***
 
S       read as  Statement and it is the StartUp Symbol
->      read as  May be replaced by
P       read as (Pronouns + some other tokens ) Class 
V       read as (Verbs + some other tokens ) Class 
C       read as (Classes + some other tokens ) Class 
I       read as (Instructions + some other tokens ) Class 
A       read as (Attributes + some other tokens ) Class 
D       read as (Data as value or Data as Expression )
(....)  read as (Real Stack Tokens without Classification and without data)
OPCode  read as Operation Code related to a command in the language

The following reference block details Supernova's context-sensitive grammar rules. These five production rules (S→SI, S→SPVC, S→SCAVD, S→SDI, S→SDVD) define how statements are structured using token classifications: Statement (S), Instruction (I), Pronoun (P), Verb (V), Class (C), Attribute (A), and Data (D). The table at the bottom shows which token class can follow each other, forming the backbone of Supernova's natural language parser.

code
The Basic Context Controlling Rules
-------------------------------------
 
S -> SI         Rule 1
S -> SPVC       Rule 2
S -> SCAVD     Rule 3  
S -> SDI       Rule 4
S -> SDVD      Rule 5
 
Since the token is one Character classification ( I, P, V, C, A & D)
is used to manage them
 
Also there are switches determine the next class
i.e. Classes are context sensitive
 
1 - I may comes only after S or D  (See Rules 1 and 4)
2 - P may comes only after S (See Rule 2)
3 - V may comes only after P, A or D (See Rules 2,3 and 5)
4 - C may comes only after V or S (See Rules 2 and 3)
5 - A may comes only after C (See Rule 3)
 
i.e. In the start of tokens classification, the expected token class
is I,P,C or D.
 
Last accepted class              Next class must be
        S                           I,P,C OR D
        I                             → S
        P                             → V
        C                             S OR A
        A                             → V
        D                            S, I OR V
        V                             C OR D

Error Messages

#Error Message
1Unexpected End IF Statement - Do IF Statement is required.
2Unclosed Do IF Statement structure - End IF Statement is required.
3Unexpected End While Statement - Do While Statement is required.
4Unclosed Do While Statement structure - End While Statement is required.
5General Syntax Error.
6Command Error, The Grammar is TRUE but the Command is undefined.
7Expression Error [Variable] is expected.
8Expression Error (Value) is expected.
9General Expression Error.
10Expression Error, Cannot determine expression result.
11Bad GUI Command (No Window Defined).
12Bad GUI Command (No Object Defined).
13Unexpected OK/End Function/End Procedure/End Of Instructions Statement
14Unclosed Procedure/.....Instructions Are/Function Statement structure

Language Grammar

The Language is not Case/Space/Line/Tab sensitive. The Token is a one character. The Grammar is Context Sensitive.

Grammar Symbols

SymbolMeaning
SStatement (StartUp Symbol)
PPronouns + some other tokens Class
VVerbs + some other tokens Class
CClasses + some other tokens Class
IInstructions + some other tokens Class
AAttributes + some other tokens Class
DData as value or Data as Expression

Basic Context Controlling Rules

S → SI       Rule 1

S → SPVC    Rule 2

S → SCAVD   Rule 3

S → SDI      Rule 4

S → SDVD    Rule 5

Classification Context Rules

Last Accepted ClassNext Class Must Be
SI, P, C or D
I→ S
P→ V
CS or A
A→ V
DS, I or V
VC or D