1. Variable problems
- Posted by "Wallace B. Riley" <wryly at MINDSPRING.COM> Aug 21, 1997
- 598 views
--=====================_872189330==_ Irv - In your reply to my inquiry about variables in Euphoria, you asked for a couple of lines from the data file to check the format. Here it is: --=====================_872189330==_ Irv - reply via listserv In your reply to my inquiry about variables in Euphoria, you asked for a couple of lines from the data file to check the format. Here it is: {{"AL","FL",208}, {"AL","GA",163}, {"AL","MS",247}, {"AL","TN",286}, {"AR","LA",333}, {"AR","MO",351}, {"AR","MS",261}, {"AR","OK",344}, {"AR","TN",351}, {"AR","TX",500}, {"AZ","CA",769}, {"AZ","NM",528}, {"AZ","NV",703}, {"AZ","UT",655}, {"CA","AZ",769},...{...},{...}} These are the first 15 elements of a sequence of 210 sub- sequences. The number in each subsequence is the distance in miles between the capitals of the two states in that subsequence. The big sequence is in a separate file; the program contains "open", "get", and "close" commands to use the file. Since the file is so large, I shudder to think of initializing each state name as a separate blank sequence. Or did you mean initialize one (or two?) variables as blank sequences, and plug the state names into them? Some of the problems that triggered my inquiry were corrected when I discovered typographical errors in the program. But some still remain. In one version of the program, I declared all the variables right after the list of 'include' files, but omitting the word 'global'. The program hangs up at a function call well along in the program, not near the beginning. The hangup comes immediately after a sequence of strings forming a dummy file that gives Euphoria a starting point. When Euphoria sees the function call, followed by a parenthesis, it says it expects 'end' instead of the parenthesis. Another version of the program declares the variables in the same place, but with the word 'global' added to each declaration. It hangs up in the same place. Previously Euphoria thought the word 'global' was itself a variable; it seems to have gotten over that problem by itself. In the third copy of the program, I placed the list of global declarations just before the 'main' part of the program, after the last procedure. Now the program finds a variable in the very first function of the program, saying that it hasn't been declared, whereas it is actually one of the global declarations. If you want to see a copy of any of the listings, or all of them, please let me know. I just saw your later message about include files. You misunderstood my comment. When I said I hadn't figured them out yet, I meant I just hadn't gotten around to writing my own. I know what they're good for. But thanks anyway. Wally Riley wryly at mindspring.com --=====================_872189330==_--