# Aros/Developer/Docs/E

* Navbar for the Aros wikibook
* Aros User
* Aros User Docs
* Aros User FAQs
* Aros User Applications
* Aros User DOS Shell
* Aros/User/AmigaLegacy
* Aros Dev Docs
* Aros Developer Docs
* Porting Software from AmigaOS/SDL
* For Zune Beginners
* Zune .MUI Classes
* For SDL Beginners
* Aros Developer BuildSystem
* Specific platforms
* Aros x86 Complete System HCL
* Aros x86 Audio/Video Support
* Aros x86 Network Support
* Aros Intel AMD x86 Installing
* Aros Storage Support IDE SATA etc
* Aros Poseidon USB Support
* x86-64 Support
* Motorola 68k Amiga Support
* Linux and FreeBSD Support
* Windows Mingw and MacOSX Support
* Android Support
* Arm Raspberry Pi Support
* PPC Power Architecture
* misc
* Aros Public License

## AmigaE

Read more here.
Amiga E, or very often simply E, is a programming language created by Wouter van Oortmerssen on the Amiga.
Amiga E is a combination of many features from a number of languages, but follows the original C Programming and C++, most closely in terms of basic concepts like in the sense that it is fast and weakly typed, and had a rich set of features from procedural, object oriented and functional programming languages.
Amiga E's main benefits are fast compilation (allowing it to be used in place of a scripting language), very readable source code, flexible type system, powerful module system, exception handling (not C++ variant) and object oriented programming.
Contact the AmigaE IRC channel irc.freenode.net at #amigaE

## PortablE

For further information and questions, Portable E has its own forum here. PortablE is an AmigaE compiler, written from scratch in E, and able to compile itself. There is a mailing list for E where you might get some answers.
Read more here.
This is how PortablE works. You write your Amiga E code, use PortablE to translate it into a .cpp file and then use any C++ compiler to compile the file into an executable. I have been using g++ inside AROS. If you want to go to Amiga Classic, you can use PortablE to translate to Amiga E and then move it to Classic where you can use an Amiga E compiler like CreativE.
If PortablE is not already set up for use, you need to set a Stack of at least 100000 to run PortablE. You can set this up by typing in the AROS shell.
You need to do an assign for PEmodules.
You can put Assign commands like this in your user-startup file in AROS so you don’t have to do it everytime. User-startup is in System:S (S drawer).
You also need some Assigns placed in there for g++. The exact Assigns you need can be found in the INSTALL file located in System:Development
So here are the commands I entered on the command line once I had things setup to test a simple program.
So then I just typed in the name of my executable at the shell and it ran and printed “Hello, World!”.

## Syntax

Read more here.

### Procedures

A "hello world" program in Amiga E calling another procedure inside

### Loops
#### Summary

* The procedure definition.
* The declaration of the procedure main, with no parameters.
* The declaration of local variables x and y
* Initialization of x and y using assignment statements.
* The WHILE loop
* The loop check for the WHILE loop using the logical operator AND, the comparison operator <, and parentheses to group the expression.
* The call to the (built-in) procedure WriteF using parameters. Notice the string, the place holders for numbers, \d, and the linefeed, \n.
* Assignments to x and y, adding two to their values.
* The marker for the end of the WHILE loop.
* The marker for the end of the procedure.
To return a value, replace ENDPROC with ENDPROC value

### Data Structures

Read more about here.
Constants
Numeric
String
Named
Enumeration
Sets

#### Types

LONG
PTR
ARRAY
OBJECT
LIST
STRING
Linked Lists

#### Built-In

* Constants - TRUE, FALSE, NIL, ALL, GADGETSIZE, OLDFILE, NEWFILE, STRLEN
* Variables - arg, wbmessage, stdout, conout, stdrast, dosbase, execbase, gfxbase, intuitionbase,
* Functions - \c (Number Character) - \d (Number Decimal) - \h (Number Hexadecimal), \s (String String)
* Functions - \l Left justify in field, \r Right justify in field, \z Set fill character to "0"
* Functions - WriteF, StringF, Out, Inp, ReadStr, FileLength, SetStdOut,
* Functions (Intuition) - OpenW, CloseW, OpenS, CloseS, Gadget, Mouse, MouseX, MouseY, WaitIMessage,
* Functions (Graphics) - Plot, Line, Box, Colour, TextF, SetStdRast, SetTopaz,
* Functions (Maths) - Abs, Even, Odd, Mod, Rnd, RndQ, Shl, Shr, Long, Int, Char, PutLong, PutInt, PutChar,
* Functions (System) - New, Dispose, DisposeLink, CleanUp, CtrlC, FreeStack,

### Exceptions
## Conversion

The hardest part when moving from BASIC to C, C++ and E is pointers & strings. E & C deal with strings in almost exactly the same way, so there is no great benefit to E there.
AmigaE's treatment of pointers is far simpler than C's, due to C's design. You have to think very carefully about what kind of pointer is required in case a "&" or "*" needs to be added. While with E there is almost never any such worry.
Plus "PTR TO xxx" seems easier to grasp than "xxx*".
Note that there are some good C guides that explain the principles of strings & pointers, using 'box & arrow' diagrams, which you may still find helpful when learning E.
You can just open workbench.library (version 44 or newer required) and call OpenWorkbenchObjectA as it is documented in autodocs.

## References

AmigaE works well and integrates with Assembly well also. Just don't go writing shared libraries with it since there are design flaws with the library mode. Also, if you plan on using multiple return codes, keep them in the same source as your application code because the module generation doesn't work right with multiple return codes. Lastly, don't nest the function form of the IF keyword (the AmigaE equivalent of the ? : operators in C). Those are all of the bugs I can think of in the compiler.