Komag
12 years agoRoku Guru
trying to print a simple array value (string), not working
This should be pretty simple:
How can I get it to print out the X? What exactly is going on?
I tried:
I also tried various versions of ToStr() such as ToStr(testArray[0]) or testArray[0].ToStr() with no luck, got dot operator error.
If my array has quotation marks it works just fine, prints X just like I want, but for some other reasons I REALLY don't want to add all the " marks to the original array
What I really want to do is check the value, not necessarily print it, such as:
but it doesn't work. It works only like this:
Is there some array command to just set all the values to be strings? Or is there a way to make ToStr() or Stri() work for me?
Or if I could just know what X actually currently is (since it's apparently not a string when I don't use the "), so I can properly check for it.
testArray = [X, Y, Z]
print testArray[0] ' this only prints <bsTypedValue: >
How can I get it to print out the X? What exactly is going on?
I tried:
print stri(testArray[0]) ' error, Type Mismatch
myString = testArray[0]
print stri(myString) ' error, Type Mismatch
I also tried various versions of ToStr() such as ToStr(testArray[0]) or testArray[0].ToStr() with no luck, got dot operator error.
If my array has quotation marks it works just fine, prints X just like I want, but for some other reasons I REALLY don't want to add all the " marks to the original array
testArray = ["X", "Y", "Z"]
print testArray[0] ' this prints X
What I really want to do is check the value, not necessarily print it, such as:
testArray = [X, Y, Z]
if testArray[0] = X then dothisdothat
but it doesn't work. It works only like this:
testArray = ["X", "Y", "Z"]
if testArray[0] = "X" then dothisdothat
Is there some array command to just set all the values to be strings? Or is there a way to make ToStr() or Stri() work for me?
Or if I could just know what X actually currently is (since it's apparently not a string when I don't use the "), so I can properly check for it.