User Tools

Site Tools


built_in:load_text

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

built_in:load_text [2015/03/21 17:45]
madlyr [Description]
built_in:load_text [2016/08/03 13:45]
Line 1: Line 1:
-=====LoadText===== 
  
-//(Information and examples taken from the DroidScript documentation)// 
- 
-====Description==== 
- 
-The **LoadText** method loads and returns a text value from the user's storage space under **valueName**. If there is no stored **valueName**, then method returns **default** value.  Use this method when saving and loading user preferences. 
- 
-The third parameter **id** is an optional text parameter and allows sharing of data across multiple Apps when the same id is used by both apps. 
- 
-<code> txt = app.LoadText( valueName, default, id );</code> 
- 
-See also [[built_in:save_text|SaveText]] 
- 
----- 
- 
-====Example==== 
- 
-<code javascript> 
- 
-function OnStart() 
-{ 
-  name = app.LoadText( "MyName", "Bill" ); 
-  app.ShowPopup( name ); 
- 
-  if( name=="Bill" ) name = "Fred"; 
-  else name = "Bill"; 
-  app.SaveText( "MyName", name ); 
- 
- 
-</code> 
built_in/load_text.txt ยท Last modified: 2016/08/03 13:45 (external edit)