testArray = [X, Y, Z]
print testArray[0] ' this only prints <bsTypedValue: >
print stri(testArray[0]) ' error, Type Mismatch
myString = testArray[0]
print stri(myString) ' error, Type Mismatch
testArray = ["X", "Y", "Z"]
print testArray[0] ' this prints X
testArray = [X, Y, Z]
if testArray[0] = X then dothisdothat
testArray = ["X", "Y", "Z"]
if testArray[0] = "X" then dothisdothat
testArray = [X, Y, Z]
print type(testArray) ' prints "roArray"
print type(testArray[0]) ' prints nothing, blank
myString = testArray[0]
print type(myString) ' prints nothing, blank
print myString ' prints "<bsTypedValue: >", what is that?
print "Hi Garrett" ' prints "Hi Garrett"
X = "Xena"
Y = "Yuma"
Z = "Zelda"
testArray = [X, Y, Z]
print type(testArray) ' prints "roArray"
print type(testArray[0]) ' "roString"
myString = testArray[0]
print type(myString) ' prints "roString"
print myString ' prints "Xena"
print "Hi Garrett" ' prints "Hi Garrett"
if testArray[0] = "Xena" then print "Yes, it's Xena" ' prints "Yes, it's Xena"
BrightScript Debugger> testArray = [X, Y, Z]
BrightScript Debugger> var
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=2
x &h0000 <uninitialized> val:Uninitialized
testarray &h0010 bsc:roArray, refcnt=1
y &h0000 <uninitialized> val:Uninitialized
z &h0000 <uninitialized> val:Uninitialized
"Komag" wrote:
So without the quotes, even something like HELLO is just a variable that hasn't been assigned a value, and only "HELLO" is a string right off the bat.
BrightScript Debugger> ? [string(5, "*"), atn(1) * 4]
*****
3.14159
"Komag" wrote:
Related question, say I have a string "map" and I want to convert to variable map, is there a way to do this?
"Komag" wrote:
Basically I want the opposite of ToStr(), I want to "unstring" a string!
IF item = "wall"
item = {
name: "wall",
blocker: TRUE,
sprite: bitmapset.animations.sprite_brickwall2
}
ELSE IF item = "pillar"
item = {
name: "pillar",
blocker: TRUE,
sprite: bitmapset.animations.sprite_pillar1
}
ELSE IF item = "door"
item = {
name: "door",
blocker: TRUE,
openable: TRUE,
sprite: bitmapset.animations.sprite_door1
}
compositor.NewAnimatedSprite(j*64, i*64, theCurrentRoom[i][j].sprite)
sprite: "bitmapset.animations.sprite_brickwall2"
CreateObject("roRegion", Object bitmap, Integer x, Integer y,Integer width, Integer height)
"Komag" wrote:
later, a function calls:compositor.NewAnimatedSprite(j*64, i*64, theCurrentRoom[i][j].sprite)
but this doesn't work.