Location: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
Brendon (talk | contribs)
Created page with "LOCATION[(''string'' | ''variable'')] '''Description''' LOCATION lets you get or set the name of the current app. It will return the URL of the current app that you are runn..."
 
Brendon (talk | contribs)
No edit summary
Line 1: Line 1:
LOCATION[(''string'' | ''variable'')]
Location[(''string'' | ''variable'')]


'''Description'''
== Description ==


LOCATION lets you get or set the name of the current app. It will return the URL of the current app that you are running. If you want to run another app, assign the URL of that app to LOCATION. In this respect, it works similarly to the CHAIN statement found in some other implementations of BASIC.  
Location lets you get or set the name of the current app. It will return the URL of the current app that you are running. If you want to run another app, assign the URL of that app to Location. In this respect, it works similarly to the Chain statement found in some other implementations of BASIC.  


To send parameters to the next app, put a question mark (?) followed by the string after the new app name.
To send parameters to the next app, put a question mark (?) followed by the string after the new app name.


'''Example'''
== Example ==


<pre>
<pre>
REM LOCATION Example
Rem Location Example
MsgBox "The name of this app is " & location
MsgBox "The name of this app is " & location
MsgBox "Going to http://www.nsbasic.com/Project1/index.html?someParameters"
MsgBox "Going to http://www.nsbasic.com/Project1/index.html?someParameters"
location = "Going to http://www.nsbasic.com/Project1/index.html?someParameters"
location = "Going to http://www.nsbasic.com/Project1/index.html?someParameters"
REM PROJECT1
Rem PROJECT1
MsgBox "Started with parameter " & location.search
MsgBox "Started with parameter " & location.search
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
?someParameters
?someParameters
</pre>
</pre>
[[Category:Language Reference]]

Revision as of 02:07, 17 August 2012

Location[(string | variable)]

Description

Location lets you get or set the name of the current app. It will return the URL of the current app that you are running. If you want to run another app, assign the URL of that app to Location. In this respect, it works similarly to the Chain statement found in some other implementations of BASIC.

To send parameters to the next app, put a question mark (?) followed by the string after the new app name.

Example

Rem Location Example
MsgBox "The name of this app is " & location
MsgBox "Going to http://www.nsbasic.com/Project1/index.html?someParameters"
location = "Going to http://www.nsbasic.com/Project1/index.html?someParameters"
…
Rem PROJECT1
MsgBox "Started with parameter " & location.search

Output

?someParameters