User Login
Name
Password
Site Contents
News
About
Download
Scripts
Tutorials
Register
Support
FAQ
Script Reference
New User


Contact Me
Xide
Online Scripting Reference

cutText

Purpose
'Cuts' a value out of a piece of text.

Syntax
cutText {value} var {start} {length}

{value}: The text to 'cut' a value out of.

var: The variable to hold the 'cut' value.

{start}: The starting index of the value to 'cut'.

{length}: The length of the value to 'cut'. If this length is longer than the end of the text being 'cut' from, the value will be 'cut' to the end of the text.



Notes
This command will copy a value out of a larger value. This is a very useful command when parsing text.

Example
# get the name of a planet being landed on

getWord CURRENTLINE $ID 2
stripText $ID "#"
getWord CURRENTLINE $Sector 5
stripText $Sector ":"
getWordPos CURRENTLINE $Pos ": "
cutText CURRENTLINE $Name ($Pos + 2) 999



Return to item listing