diff --git a/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Getting-a-STRING-from-a-NUMERIC-object.wiki b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Getting-a-STRING-from-a-NUMERIC-object.wiki new file mode 100644 index 00000000..15b146bd --- /dev/null +++ b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Getting-a-STRING-from-a-NUMERIC-object.wiki @@ -0,0 +1,15 @@ +[[Property:uuid|B74D374E-895C-4F22-B95F-656BD78ECD03]] +[[Property:weight|1000]] +[[Property:title|Getting a STRING from a NUMERIC object]] +[[Property:link_title|NUMERIC to STRING]] +Every class has the out method that can be used to get a text version of the object. For a lot of class, this method return internal informations that are not really useful for the end user. But for every NUMERIC class, the out method return a text representation of the number that the NUMERIC object represents. + + + print_integer(a_integer:INTEGER) + -- Print the value of `a_integer' + do + print(a_integer.out + "%N") + end + + +Note that for more advance convertion, you can also used convertion class like FORMAT_DOUBLE. \ No newline at end of file diff --git a/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Iterate-on-a-LIST-and-removing-object.wiki b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Iterate-on-a-LIST-and-removing-object.wiki new file mode 100644 index 00000000..819e8d18 --- /dev/null +++ b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Iterate-on-a-LIST-and-removing-object.wiki @@ -0,0 +1,26 @@ +[[Property:uuid|78393BBA-9B1E-4523-9881-3D83CEB6A952]] +[[Property:weight|3000]] +[[Property:title|Removing object while iterating on a LIST]] +If you already have the object that you want to remove from the LIST you can easily use prune and prune_all. But if you want to remove objects while iterating on that LIST, depending on criteria on the objects contained in the LIST, here what you can do. + +First of all, if you think about removing object while iterating, I do not recommend using an across loop. If you iterate on the list using a from until loop end, just remember to use the LIST.forth only when you do not use LIST.remove. + +For example, let's say we have class MY_CLASS with an attribute has_stopped and that I want to remove every object of a LIST that has this attribute set to True. Here what the code will look like. + + + removing_stopped(a_list:LIST[MY_CLASS]) + -- Removing every closed element of `a_list' + do + from + a_list.start + until + a_list.exhausted + loop + if a_list.item.has_stoped then + a_list.remove + else + a_list.forth + end + end + end + \ No newline at end of file diff --git a/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Iterating-on-a-LIST.wiki b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Iterating-on-a-LIST.wiki new file mode 100644 index 00000000..dcdba9ee --- /dev/null +++ b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Iterating-on-a-LIST.wiki @@ -0,0 +1,35 @@ +[[Property:uuid|96077603-DD2D-4D8C-A486-AF4BD066613A]] +[[Property:weight|2000]] +[[Property:title|Iterating on a LIST]] +There are two Eiffel mechanisms to iterate on every element of a LIST. + +The first it the across loop. The across can be used on every ITERABLE object (including LIST objects). + + + print_elements(a_list:LIST[INTEGER]) + -- Print every elements on `a_list' + do + across a_list as la_list loop + print(la_list.item.out + "%N") + end + end + + +Note that the temporary variable (la_list in the example) represent an iterator of the ITERABLE object, and not directly an element like in many other languages (like the for structure in Python for example). + +The other mechanism uses the from until loop syntax. This syntax offer more possibilities than the across loop, but is riskier. + + + print_elements(a_list:LIST[INTEGER]) + -- Print every elements on `a_list' + do + from + a_list.start + until + a_list.exhausted + loop + print(a_list.item.out + "%N") + a_list.forth + end + end + \ No newline at end of file diff --git a/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Managing-CTRL-C-on-console.wiki b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Managing-CTRL-C-on-console.wiki new file mode 100644 index 00000000..bd2f1204 --- /dev/null +++ b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/Managing-CTRL-C-on-console.wiki @@ -0,0 +1,50 @@ +[[Property:uuid|5CA34C5D-30F1-4D6F-9FE4-B555E541EA8C]] +[[Property:weight|4000]] +[[Property:title|Managing CTRL+C in console application]] +Normally, if the user use the CTRL+C keys, the Eiffel application detect it as an error and throw an exception of type OPERATING_SYSTEM_SIGNAL_FAILURE. + +To manage the CTRL+C keys, you can use a rescue clause to detect the exception and a retry mecanism to cancel the exception handeling done by the Eiffel runtime. + +To detect the exception, you can inherit from the EXCEPTIONS class and use an attachment test on Exception_manager.last_exception. + + +note + description: "Show how to quit an application using CTRL+C (without trace)." + author: "Louis Marchand" + date: "Wed, 25 Apr 2018 23:12:33 +0000" + revision: "0.1" + +class + APPLICATION + +inherit + EXCEPTIONS + +create + make + +feature {NONE} -- Initialization + + make + -- Launch `Current'. + local + l_ctrl_c:BOOLEAN + do + if not l_ctrl_c then + from until False loop + io.standard_default.put_string ("Press CTRL+C%N") + io.input.read_line + end + else + io.standard_default.put_string ("%NClosing...%N") + end + rescue + if attached {OPERATING_SYSTEM_SIGNAL_FAILURE} + Exception_manager.last_exception then + l_ctrl_c := True + retry + end + end + +end + \ No newline at end of file diff --git a/documentation/trunk/eiffel/Tutorials/Mini-HowTo/index.wiki b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/index.wiki new file mode 100644 index 00000000..8eab50e8 --- /dev/null +++ b/documentation/trunk/eiffel/Tutorials/Mini-HowTo/index.wiki @@ -0,0 +1,7 @@ +[[Property:link_title|Mini How-tos]] +[[Property:uuid|B2E4622A-2495-47DD-9C02-B9940A026EC1]] +[[Property:weight|0]] +[[Property:title|Mini How-tos]] +In this section, you will find little how-tos that can be used to know how to used some very specific mechanics in Eiffel. Those how-tos are small by design and can be used to show very fundamental mechanisms for beginners or more advance mechanisms. + + diff --git a/documentation/trunk/eiffelstudio/eiffelstudio-reference/debugger/object-tool/index.wiki b/documentation/trunk/eiffelstudio/eiffelstudio-reference/debugger/object-tool/index.wiki index 4db06109..3963a1c8 100644 --- a/documentation/trunk/eiffelstudio/eiffelstudio-reference/debugger/object-tool/index.wiki +++ b/documentation/trunk/eiffelstudio/eiffelstudio-reference/debugger/object-tool/index.wiki @@ -21,7 +21,7 @@ It is also possible to use the [[Set slice size command|set slice size command]] -'''The tool bar buttons:'''
+'''The toolbar buttons:'''
* the [[Remove object command|remove object command]] [[Image:general-delete-icon]]
* the [[Set slice size command|set slice size command]] [[Image:debugger-set-sizes-icon]] .
* the button [[Image:debugger-expand-info-icon]] can give an [[Object Viewer (also known as Expanded display)|expanded display]] of the string relative to an object, by dropping the object onto the button (or pressing Ctrl+E on the selected value). Use it if an object has a very long string representation or a string representation that contains carriage returns, for example.
@@ -29,7 +29,7 @@ It is also possible to use the [[Set slice size command|set slice size command]] * and the button [[Image:execution-object-storage-icon]] controls the [[Debuggee's Object Storage|remote object storage]] . -{{tip|The tool's layout can be customized to have 2 side-by-side "left" and "right" grids holding the various information. This can be done using the button ( [[Image:toolbar-dropdown-icon]] ) from the tool bar which open the objects tool menu and then select "Edit Layout". Then you can use the tool layout editor as shown below to adjust which information you want displayed in each of the two sides. }} +{{tip|The tool's layout can be customized to have 2 side-by-side "left" and "right" grids holding the various information. This can be done using the button ( [[Image:toolbar-dropdown-icon]] ) from the toolbar which open the objects tool menu and then select "Edit Layout". Then you can use the tool layout editor as shown below to adjust which information you want displayed in each of the two sides. }} [[Image:object-tool-layout-editor]] diff --git a/documentation/trunk/eiffelstudio/eiffelstudio-reference/debugger/object-tool/set-slice-size-command.wiki b/documentation/trunk/eiffelstudio/eiffelstudio-reference/debugger/object-tool/set-slice-size-command.wiki index 529d5b5b..04403c63 100644 --- a/documentation/trunk/eiffelstudio/eiffelstudio-reference/debugger/object-tool/set-slice-size-command.wiki +++ b/documentation/trunk/eiffelstudio/eiffelstudio-reference/debugger/object-tool/set-slice-size-command.wiki @@ -1,7 +1,7 @@ [[Property:title|Set slice size command]] [[Property:weight|3]] [[Property:uuid|ce2469a3-cf00-554e-47bd-5e8b2fdbc783]] -Located in the object tool toolbar, this command [[Image:debugger-set-sizes-icon]] changes the display size of special objects (i.e. objects whose class is [[ref:libraries/base/reference/special_chart|SPECIAL]] ). Because special objects may contain thousands of attributes, only the first fifty are displayed by default. If left-clicked, a dialog is popped up that sets the exploration indices of special objects that will be loaded in the future. +Located in the object tool toolbar, this command [[Image:debugger-set-sizes-icon]] changes the display size of special objects (i.e. objects whose class is [[ref:libraries/base/reference/special_chart|SPECIAL]], most importantly in the representation of arrays and strings). Because special objects may contain thousands of attributes, only the first fifty are displayed by default. If left-clicked, a dialog is popped up that sets the exploration indices of special objects that will be loaded in the future. This pop-up also shows the "Maximum displayed string size" in the grid ([[Object tool|object tool]], or the [[Expression evaluation|watch tools]]). diff --git a/documentation/trunk/eiffelstudio/getting_started/setup-and-installation/software-installation-eiffelstudio/eiffelstudio-linux.wiki b/documentation/trunk/eiffelstudio/getting_started/setup-and-installation/software-installation-eiffelstudio/eiffelstudio-linux.wiki index 48e14e51..4bd9b36a 100644 --- a/documentation/trunk/eiffelstudio/getting_started/setup-and-installation/software-installation-eiffelstudio/eiffelstudio-linux.wiki +++ b/documentation/trunk/eiffelstudio/getting_started/setup-and-installation/software-installation-eiffelstudio/eiffelstudio-linux.wiki @@ -56,28 +56,47 @@ cp -r /mnt/cdrom/EiffelXX . This will install the EiffelStudio files into /usr/local/EiffelXX. To complete the installation of EiffelStudio, jump to the next section, [[#Setting up EiffelStudio|Setting up EiffelStudio]]. + ==Setting up EiffelStudio== Once the files have been installed, you should define the following environment variables in order to run EiffelStudio: * '''ISE_EIFFEL''' to /usr/local/EiffelXX -* '''ISE_PLATFORM''' to linux-x86 for the 32 bits version or linux-x86-64 for the 64 bits version. We will be using '''linux-x86''' in the examples below. +* '''ISE_PLATFORM''' to linux-x86 for the 32 bits version or linux-x86-64 for the 64 bits version. We will be using '''linux-x86-64''' in the examples below. and add $'''ISE_EIFFEL'''/studio/spec/$'''ISE_PLATFORM'''/bin to your '''PATH''' environment variable. Using sh or bash as a shell, it suffices to type the following commands: export ISE_EIFFEL=/usr/local/EiffelXX -export ISE_PLATFORM=linux-x86 +export ISE_PLATFORM=linux-x86-64 export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin Using csh or tcsh as a shell, it suffices to type the following commands: setenv ISE_EIFFEL /usr/local/EiffelXX -setenv ISE_PLATFORM linux-x86 +setenv ISE_PLATFORM linux-x86-64 set path = ($path $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin) If you are using the Enterprise edition, please follow the instructions of the next section, [[#Registering the Enterprise Edition|Registering the Enterprise Edition]], otherwise jump to the [[#Using EiffelStudio|Using EiffelStudio]] section at the end of this document. + +== Installing EiffelStudio on Ubuntu == +An alternative to previous solution for Ubuntu, is to use the ppa repository. +```shell +sudo add-apt-repository ppa:eiffelstudio-team/ppa +sudo apt-get update +sudo apt-get install eiffelstudio +``` +It installs EiffelStudio using the linux layout, so no specific environment variables are needed (note: ISE_EIFFEL and ISE_PLATFORM should not be set to use this linux layout). +The executable are located under `/usr/bin`, libraries under `/usr/lib/eiffelstudio`, ... + +To reinstall, or update: +```shell +sudo apt-get purge eiffelstudio +sudo apt-get update +sudo apt-get install eiffelstudio +``` + ==Registering the Enterprise Edition==