Title: | *OLD* ALL-IN-1 (tm) Support Conference |
Notice: | Closed - See Note 4331.l to move to IOSG::ALL-IN-1 |
Moderator: | IOSG::PYE |
Created: | Thu Jan 30 1992 |
Last Modified: | Tue Jan 23 1996 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 4343 |
Total number of notes: | 18308 |
Hello, This might be a stupid question but here it goes: Is there a way to simulate data structures, like arrays and structs, in ALL-IN-1? The reason why I'm asking is that a customer of ours has written a very large ALL-IN-1 application, where they are using thousands of local symbols. These symbols are there to simulate arrays. Instead of doing something like: for (n=1,n<100,n++) symbol[n] = tmp; they have to do: GET #SYMBOL1 = #TMP GET #SYMBOL2 = #TMP GET #SYMBOL3 = #TMP ... GET #SYMBOL100 = #TMP The problem they are experiencing is that they get a very large amount of code, which they think slows down the application. Is there some way to simulate arrays in ALL-IN-1? Regards, Mats Wilhelmsson, Stockholm
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
2181.1 | On-the-fly variable names | GANTRY::HULL | Digital Services Delivery - Motown | Sun Jan 31 1993 12:55 | 21 |
Unless the wizards in Engineering are hiding something from us there's no direct support for arrays in ALL-IN-1. However, your coding style can be greatly simplified by building the temp variable names dynamically, ie: get #cnt = 1 .label loop get oa$function = 'get #symbol_' #cnt ' = #somevalue' increment #cnt if #cnt > 100 then .goto exit_loop .goto loop .label exit_loop ...the crucial line being the 3rd where you construct the variable name on -the-fly. We did they for a massive multi-column boilerplate that had to be dynamically built to handle varying amounts of columnar data. We even had it double-looped, for column and line-number (ie #sym_2_55). works like a champ. As you can see, you can drastically shorten up your code and make it more flexible at the same time. Al |