Page 1 of 1 1
Topic Options
#118816 - 2004-04-29 07:34 PM Display a variable
Sardis Offline
Fresh Scripter

Registered: 2004-01-16
Posts: 28
Loc: Montgomery, AL
How can you display the contents of a variable in a script?
_________________________
Jason A King

Top
#118817 - 2004-04-29 07:49 PM Re: Display a variable
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
kind of a open question....

$variable

would all that you would need...

perhaps if you told us more on what you are trying to do?

Top
#118818 - 2004-04-29 08:11 PM Re: Display a variable
Sardis Offline
Fresh Scripter

Registered: 2004-01-16
Posts: 28
Loc: Montgomery, AL
Ok, I actually need to learn how to use labels so I can use the goto feature. How do I assign a section of code a lable so I can reference it in code?
_________________________
Jason A King

Top
#118819 - 2004-04-29 08:32 PM Re: Display a variable
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Straight from the manual...

Quote:

Action: Defines a label within the script file to which you can transfer control.

Syntax: :label

Remarks: Labels must be unique within a script or user defined function and cannot contain whitespace characters. Note also that you can define labels inside script segments (for example inside a WHILE – LOOP segment), but you cannot jump to such a label from outside the segment.




Top
#118820 - 2004-04-29 08:35 PM Re: Display a variable
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Here's a fun little example for you

Code:
:testlabel
$x = $x+1
? $x
GoTo "testlabel"


Top
#118821 - 2004-04-29 10:30 PM Re: Display a variable
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Quote:

Ok, I actually need to learn how to use labels so I can use the goto feature. How do I assign a section of code a lable so I can reference it in code?




ahhh, i would say take a look at the FUNCTION stuff.

Code:

$say = myword("hello")
? $say

$say = Myword("Functions are fun")
? $say

$say = myword("test 1 2 3")
? $say


quit


function myword($word)
$myword = "I want to say:" + $word
endfunction



You will always be able to access the same bit of code by using the same function over and over again.

Bryce

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.045 seconds in which 0.019 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org