Variables
4 messages in this thread
Hi…
I have a question that I am passing along from a friend…
"Can the Director 2 translate string variables to integer variables, and
vice versa?"
He is looking to do an application that involves an NEC PC-VCR; such
translation would make his life much easier.
Thanks
Jonathan
If I understand your question correctly, you can easily convert a string
that contains numeric digits into a numeric variable with a simple
assignment:
val = txt$
This can also be performed if the numeric digits are imbedded within a
longer string:
dim txt[100]
txt$="abcd93efgh"
n = txt$[5]
This will convert the 93 that begins at location 5 of the text string to a
numeric 93 contained in the variable "n".
Keith
Thanks for the reply…will pass it on to Mr. Lombardi.
Oh, and I forgot, you can input values that contain decimal points which is
documented in Appendix D (on D-4). A conversion such as:
txt$="27.52"
n = txt$
will result in setting "n" to 2752, and the system variable decimal.places
to 2, indicating that the number is multiplied times 10 to the 2nd power.
Keith