CompuServe Thread

Variables

4 messages in this thread
#31904From: Jonathan HirschmanDec 19, 1991 10:04 AM
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
#32037From: Right Ans. Inc., DoyleDec 21, 1991 3:20 AM
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
#32106From: Jonathan HirschmanDec 22, 1991 1:32 AM
Thanks for the reply…will pass it on to Mr. Lombardi.
#32038From: Right Ans. Inc., DoyleDec 21, 1991 3:24 AM
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