User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.50 is out since Jan 1st 2022


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

sample_code:start

This is an old revision of the document!


<Type Name=“StackOverflowException” FullName=“System.StackOverflowException”>

<TypeSignature Language="C#" Value="public sealed class StackOverflowException : SystemException" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit StackOverflowException extends System.SystemException" />
<TypeSignature Language="DocId" Value="T:System.StackOverflowException" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class StackOverflowException&#xA;Inherits SystemException" />
<TypeSignature Language="C++ CLI" Value="public ref class StackOverflowException sealed : SystemException" />
<TypeSignature Language="F#" Value="type StackOverflowException = class&#xA;    inherit SystemException" />
<AssemblyInfo>
  <AssemblyName>mscorlib</AssemblyName>
  <AssemblyVersion>1.0.5000.0</AssemblyVersion>
  <AssemblyVersion>2.0.0.0</AssemblyVersion>
  <AssemblyVersion>2.0.5.0</AssemblyVersion>
  <AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
  <AssemblyName>netstandard</AssemblyName>
  <AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
  <AssemblyName>System.Runtime</AssemblyName>
  <AssemblyVersion>4.2.0.0</AssemblyVersion>
  <AssemblyVersion>4.2.1.0</AssemblyVersion>
</AssemblyInfo>
<Base>
  <BaseTypeName>System.SystemException</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
  <Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
    <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
  </Attribute>
  <Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
    <AttributeName>System.Serializable</AttributeName>
  </Attribute>
</Attributes>
<Docs>
  <summary>The exception that is thrown when the execution stack overflows because it contains too many nested method calls. This class cannot be inherited.</summary>
  <remarks>
    <format type="text/markdown"><![CDATA[  

## Remarks <xref:System.StackOverflowException> is thrown for execution stack overflow errors, typically in case of a very deep or unbounded recursion.

<xref:System.StackOverflowException> uses the HRESULT COR_E_STACKOVERFLOW, which has the value 0x800703E9. The <xref:System.Reflection.Emit.OpCodes.Localloc> intermediate language (IL) instruction throws <xref:System.StackOverflowException>. For a list of initial property values for a <xref:System.StackOverflowException> object, see the <xref:System.StackOverflowException.%23ctor%2A> constructors.

## Version Considerations In the .NET Framework 1.0 and 1.1, you could catch a <xref:System.StackOverflowException> object (for example, to recover from unbounded recursion). Starting with the .NET Framework 2.0, you can't catch a <xref:System.StackOverflowException> object with a `try`/`catch` block, and the corresponding process is terminated by default. Consequently, you should write your code to detect and prevent a stack overflow. For example, if your app depends on recursion, use a counter or a state condition to terminate the recursive loop. The following example uses a counter to ensure that the number of recursive calls to the `Execute` method do not exceed a maximum defined by the MAX_RECURSIVE_CALLS constant.

[!code-csharp[System.StackOverflowException.Class#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.stackoverflowexception.class/cs/example1a.cs#1)] [!code-vb[System.StackOverflowException.Class#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.stackoverflowexception.class/vb/example1a.vb#1)]

> [!NOTE]

Applying the <xref:System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute> attribute to a method that throws a <xref:System.StackOverflowException> has no effect. You still cannot handle the exception from user code.

If your app hosts the common language runtime (CLR), it can specify that the CLR should unload the application domain where the stack overflow exception occurs and let the corresponding process continue. For more information, see [ICLRPolicyManager Interface](~/docs/framework/unmanaged-api/hosting/iclrpolicymanager-interface.md).

]]></format>

  </remarks>
  <altmember cref="T:System.Exception" />
  <related type="Article" href="~/docs/standard/exceptions/index.md">Handling and Throwing Exceptions</related>
</Docs>
<Members>
  <MemberGroup MemberName=".ctor">
    <AssemblyInfo>
      <AssemblyName>mscorlib</AssemblyName>
      <AssemblyVersion>2.0.5.0</AssemblyVersion>
      <AssemblyVersion>4.0.0.0</AssemblyVersion>
    </AssemblyInfo>
    <Docs>
      <summary>Initializes a new instance of the <see cref="T:System.StackOverflowException" /> class.</summary>
    </Docs>
  </MemberGroup>
  <Member MemberName=".ctor">
    <MemberSignature Language="C#" Value="public StackOverflowException ();" />
    <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
    <MemberSignature Language="DocId" Value="M:System.StackOverflowException.#ctor" />
    <MemberSignature Language="VB.NET" Value="Public Sub New ()" />
    <MemberSignature Language="C++ CLI" Value="public:&#xA; StackOverflowException();" />
    <MemberType>Constructor</MemberType>
    <AssemblyInfo>
      <AssemblyName>mscorlib</AssemblyName>
      <AssemblyVersion>1.0.5000.0</AssemblyVersion>
      <AssemblyVersion>2.0.0.0</AssemblyVersion>
      <AssemblyVersion>2.0.5.0</AssemblyVersion>
      <AssemblyVersion>4.0.0.0</AssemblyVersion>
    </AssemblyInfo>
    <AssemblyInfo>
      <AssemblyName>netstandard</AssemblyName>
      <AssemblyVersion>2.0.0.0</AssemblyVersion>
    </AssemblyInfo>
    <AssemblyInfo>
      <AssemblyName>System.Runtime</AssemblyName>
      <AssemblyVersion>4.2.0.0</AssemblyVersion>
      <AssemblyVersion>4.2.1.0</AssemblyVersion>
    </AssemblyInfo>
    <Parameters />
    <Docs>
      <summary>Initializes a new instance of the <see cref="T:System.StackOverflowException" /> class, setting the <see cref="P:System.Exception.Message" /> property of the new instance to a system-supplied message that describes the error, such as "The requested operation caused a stack overflow." This message takes into account the current system culture.</summary>
      <remarks>
        <format type="text/markdown"><![CDATA[  

## Remarks

The following table shows the initial property values for an instance of <xref:System.StackOverflowException>.

|Property|Value|

————–———–
<xref:System.Exception.InnerException%2A>`null`.
<xref:System.Exception.Message%2A>The localized error message string.

The following table shows the initial property values for an instance of <xref:System.StackOverflowException>.

|Property|Value|

————–———–
<xref:System.Exception.InnerException%2A>A null reference (`Nothing` in Visual Basic).
<xref:System.Exception.Message%2A>The error message string.

An exception that is thrown as a direct result of a previous exception can include a reference to the previous exception in the <xref:System.Exception.InnerException%2A> property. The <xref:System.Exception.InnerException%2A> property returns the same value that is passed into the constructor, or a null reference (`Nothing` in Visual Basic) if the <xref:System.Exception.InnerException%2A> property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of <xref:System.StackOverflowException>.

|Property|Value|

————–———–
<xref:System.Exception.InnerException%2A>The inner exception reference.
<xref:System.Exception.Message%2A>The error message string.

Sample programs

Dice- This is a simple dice game.
Digital Clock- Shows Time and date.
DroidScript Console- Similar to command prompt in Windows.
Filter- This sample shows how to filter items in a list.
Battery Level- Shows Battery Level.
App Update - Check if an update for the app is available
Torch - This is a simple flashlight app.
Volume Box - You can view and adjust volume on your device
Backup Apps as Zip - Shows how to Backup your Appfolder as Zip file
Custom Buttons - Button Styles sample provided with DroidScript
CameraView Colour Effects - Demo available colour effects
Date Difference Displays the difference between two dates as Years, months days
Dialogbox - Sample how to create a simple Dialog
Drawing demo - Simple drawing demo
Draw smiley - Use Canvas Drawing Function To Draw A Smiley
Display /Sys resources - Show included images and sounds
Extra Keys - Help! It's really difficult to get to the curly braces on my keyboard!
File Picker - Sample for a Filepicker
Folder Picker - Sample for a Folderpicker
Get Device Infos - Send your Deviceinfos to clipboard
Decimal Values in a Textedit - Allows just decimal values in a textedit
Get Number in a Textedit - Test if a value in a Textedit is a number
Image Toggle Button - Take a image as toggle Button
Image Pixel - Show colour of touched pixel
Image array - store value of clicked rectangles in 2d array
Control an image - great sample by Dirk using image.DrawImageMtx
Image rotate - rotate x×y images using image.DrawImageMtx
Layout Children - Functions to manipulate controls on a layout
Listing files on NXT - Sample app
Low Random File Acces - Sample and Infos from Dave Smart
Method finder - Introspection lite tool for home use by Steve Garman
Pincode - Excellent pincode entry facility with optional hidden input
Send App to Back - Sample how to send your App to the Background and restart it
Shake - Use accelerometer to detect device shaken
Use SimulateTouch - Sample to show how you can use the app.SimulateTouch method
Slide Menu - swipe to close
Unit Conversion - Simplistic unit-conversion demo
Visitor log - Full working example of a visitor sign-in log for my workplace
Web View - Simple webview demo
Load Webpage content - Shows how to load a webpagetext into a variable
Sample XMLHttpRequest - simple Roku remote demonstrates XMLHttpRequest
superuser on rooted device
shell access
list writeable mounted paths - List free space on mounted writeable paths
Using app.Execute - How to use app.Execute to get DS to respond to buttons/links etc in a Webview
Website File Check Service - Service to keep checking whether a file on a webserver has changed


Dialogs - ready to use

About Dialog - Show a simple Dialog to display some infos
Colorpicker - Pick a color and take the Hex-Colorcode result for formating or in your code
FontAwesomepicker - Pick a icon and take the name of it as text or in your code
New File Dialog - Show a dialog and create a new file in a folder
New Folder Dialog - Show a dialog and create a new folder in the path
Dialog for user input Get a string from the user
Custom Yes-No Dialog - Sample how to create a simple custom dialog, displayed if Back-Button is touched
Navigate Droidscript Databases First draft to navigate multidatabases, tables, columns and see values.


Snippets, Functions

Count List-Items - a function to count the items in a list-control
List Folders and Subfolders - All folders and subfolders in a list-control
Sort List - sort a List
Spinner GetSelectedItemNumber - Get the Number of the selected Spinner Item
Tab-Select - shows how you can select a Tab with an button command
Unzip Folders - a function to unzip folders to an path
JSON functions - Store objects in text files
TextEdit Search - Search for string in a TextEdit control
File Hex Viewer display a file in hex
Search search


Samples on the forum

Links to samples on the official DroidScript forum


Tips and Tricks

Note for contributors

If you wish to create a new page in the Sample Code namespace, please create a link to the new page above, save this page and click on the link you just created.

sample_code/start.1546178108.txt.gz · Last modified: 2018/12/30 21:55 (external edit)