Skip to content

Commit 0fad24e

Browse files
committed
v1.1.1 is out!
1 parent f696137 commit 0fad24e

File tree

4 files changed

+61
-27
lines changed

4 files changed

+61
-27
lines changed

build-installer/cpc

-8 Bytes
Binary file not shown.

docs.md

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
- [Syntax](#syntax)
99
* [Syntax Overview](#syntax-overview)
1010
* [Commands Built-In](#commands-built-in)
11-
- [Examples](#examples)
12-
* [Hello World](#hello-world)
13-
* [Get User's Name and Age and then Display Information](#get-user-s-name-and-age-and-then-display-information)
14-
* [Example GUI](#example-gui)
11+
- [Variables](#variables)
12+
* [Creating a variable](#creating-a-variable)
13+
* [Calling a variable](#calling-a-variable)
1514
- [Modifications](#modifications)
1615
* [libguimod](#libguimod)
1716
- [Conditions and Loops](#conditions-and-loops)
@@ -22,6 +21,10 @@
2221
- [Functions](#functions)
2322
* [Creating a function](#creating-a-function)
2423
* [Calling a function](#calling-a-function)
24+
- [Examples](#examples)
25+
* [Hello World](#hello-world)
26+
* [Get User's Name and Age and then Display Information](#get-user-s-name-and-age-and-then-display-information)
27+
* [Example GUI](#example-gui)
2528

2629
---
2730

@@ -56,32 +59,29 @@ command argument1 argument2 argument3...
5659

5760
---
5861

59-
## Examples
60-
### Hello World
61-
62+
## Variables
63+
### Creating a variable
6264
```
63-
putln Hello World!
65+
Types:
66+
- string (s, str, or string can be used to declare a string)
67+
- intiger (i, int, or intiger can be used to declare an intiger)
6468
```
65-
### Get User's Name and Age and then Display Information
69+
Syntax for creating a variable:
6670
```
67-
getinput Please Enter your Name:
68-
name = inputresult
69-
getinput Please Enter your Age:
70-
age = inputresult
71-
putln Hello {name}, you are {age}.
71+
type varname = varvalue
7272
```
7373

74-
### Example GUI
74+
### Calling a variable
75+
To call a varible, use `{varname}`, for example:
7576
```
76-
#addmod libguimod
77-
BEGIN examplefunc
78-
putln Hello World
79-
gui setup examplegui
80-
gui createlabel Click the Button Below to Display Hello World in Terminal
81-
gui createbutton examplefunc Click Here for Hello World in Terminal
82-
gui createbutton nocmd Click Here for Absolutely Nothing (also a feature of C+)
83-
gui run
77+
str name = James
78+
putln Hello, {name}, have a nice day!
79+
```
80+
then the output will be:
81+
```
82+
Hello, James, have a nice day!
8483
```
84+
8585
---
8686

8787
## Modifications
@@ -97,6 +97,9 @@ libguimod is a modification that allows you to build gui applications.
9797
`gui createbutton` - Creates a button inside main window. Uses arg1 as command (nocmd for no command), uses arg2 to end for button text.
9898

9999
`gui run` - Runs the GUI.
100+
101+
---
102+
100103
## Conditions and Loops
101104
C+ Features If, For, Forever, and While Loops.
102105

@@ -130,6 +133,8 @@ WHILE condition
130133
Do Something
131134
```
132135

136+
---
137+
133138
## Functions
134139
Functions are an essencial part of programming, it is a group of reuseable commands that can be called using only one command.
135140

@@ -146,6 +151,35 @@ To call a function, just put the function name on a line like so.
146151
function_name
147152
```
148153

154+
---
155+
156+
## Examples
157+
### Hello World
158+
159+
```
160+
putln Hello World!
161+
```
162+
### Get User's Name and Age and then Display Information
163+
```
164+
getinput Please Enter your Name:
165+
s name = inputresult
166+
getinput Please Enter your Age:
167+
s age = inputresult
168+
putln Hello {name}, you are {age}.
169+
```
170+
171+
### Example GUI
172+
```
173+
#addmod libguimod
174+
BEGIN examplefunc
175+
putln Hello World
176+
gui setup examplegui
177+
gui createlabel Click the Button Below to Display Hello World in Terminal
178+
gui createbutton examplefunc Click Here for Hello World in Terminal
179+
gui createbutton nocmd Click Here for Absolutely Nothing (also a feature of C+)
180+
gui run
181+
```
182+
149183
---
150184
<br>
151185
<div style="text-align: center;"><small>Copyright (c) 2022 Jiusoft</small></div>

examples/c+/nameandage.cps

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
getinput Please Enter your Name:
2-
name = inputresult
2+
s name = inputresult
33
getinput Please Enter your Age:
4-
age = inputresult
4+
s age = inputresult
55
putln Hello {name}, you are {age}.

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ def toPython(code):
8989
if "args" in command_list:
9090
to_return = "print('Taken Variable Name: args (used for arguments passed to program)')"
9191
elif command_list[0] == "i" or command_list[0] == "int" or command_list[0]== "intiger":
92-
to_return = f'{command_list[1]} = int({command_list[3:]})'
92+
to_return = f'{command_list[1]} = int({" ".join(command_list[3:])})'
9393
elif command_list[0] == "s" or command_list[0] == "str" or command_list[0] == "string":
94-
to_return = f'{command_list[1]} = "{command_list[3:]}"'
94+
to_return = f'{command_list[1]} = "{" ".join(command_list[3:])}"'
9595
else:
9696
to_return = "print('Variable Type not Specified.')"
9797
elif main == "IF":

0 commit comments

Comments
 (0)