Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!bbn!uwmcsd1!ig!jade!ucbvax!ucdavis!caldwr!kwongj From: kwongj@caldwr.UUCP Newsgroups: comp.sys.apollo Subject: Dynamic Allocation in an Aegis Script ??? Message-ID: <207@caldwr.caldwr.gov> Date: Tue, 17-Nov-87 19:37:00 EST Article-I.D.: caldwr.207 Posted: Tue Nov 17 19:37:00 1987 Date-Received: Fri, 20-Nov-87 05:31:53 EST Organization: California Department of Water Resources Lines: 45 To Aegis Users: I have here an Aegis script that prompts a user for a number which is used in part to create variables "dynamically". These variables are created by concatenating a string prefix to the loop counter number. The problem is that I can't evaluate it in the same manner. It appears to be assigning values into the variables since I am able to print out the variable if I explicitly type out the name of the desired variable. --------------------------Aegis script------------------------ #!/com/sh read -prompt "Enter number of elements:" -type integer num args ((^num)) FOR n := 0 to ((^num)) args ((^n)) "var^n" := ^n ENDFOR #Check that other "var"s contain expected values. Assuming you entered #a number greater or equal to 3. args (("This will print out the first element "+ ^var0)) args (("This will print out the third element "+ ^var3)) #args (("This will print out the third element "+ ^var100)) read -prompt "Enter desired element:" -type integer i # # How do you print the value of these 'dynamic' variables ?? #These two statement print the string "vari" where i=number you entered. # args (("var^i")) args ((var^i)) ---------------------------End of Aegis Script------------------- BTW Aegis SR9.5, DN3000s, Domain IX 9.5 James Kwong Calif. Depart. of Water Resources 1416 9 th Street Rm. 249 Sacramento, CA 95802 (916) 322-9430 ucdavis.edu!caldwr!kwongj (Internet) ...!ucbvax!ucdavis!caldwr!kwongj (UUCP) Disclaimer: The opinions expressed above are mine, not those of the State of California or the California Department of Water Resources.