Rev 15517 | Rev 15704 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 15517 | Rev 15542 | ||
---|---|---|---|
Line 1696... | Line 1696... | ||
1696 | setvar(names[i],buf); |
1696 | setvar(names[i],buf); |
1697 | } |
1697 | } |
1698 | } |
1698 | } |
1699 | } |
1699 | } |
1700 | 1700 | ||
1701 | /* reset variables */ |
1701 | /* reset variables - the syntax name[10] is allowed*/ |
1702 | void exec_reset(char *p) |
1702 | void exec_reset(char *p) |
1703 | { |
1703 | { |
- | 1704 | char *p1, *p2, *p3, *p4, buf[100]; |
|
1704 |
|
1705 | int i, n; |
1705 | 1706 | ||
1706 | items2words(p); |
1707 | items2words(p); |
1707 | for(p1=find_word_start(p); *p1; p1=find_word_start(p2)) { |
1708 | for(p1=find_word_start(p); *p1; p1=find_word_start(p2)) { |
1708 | p2=find_word_end(p1); if(*p2) *p2++=0; |
1709 | p2=find_word_end(p1); if(*p2) *p2++=0; |
- | 1710 | substit(p1); |
|
- | 1711 | p3=strchr(p1,'['); |
|
- | 1712 | if (p3 != NULL) { |
|
- | 1713 | *p3++ = 0; |
|
- | 1714 | p4 = find_matching(p3, ']'); |
|
- | 1715 | if (p4 == NULL) module_error("nomatching"); |
|
- | 1716 | *p4=0; |
|
- | 1717 | n = atoi(p3); |
|
- | 1718 | for (i = 1; i<=n; ++i) { |
|
- | 1719 | snprintf(buf, sizeof(buf),"%s%d",p1,i); |
|
- | 1720 | setvar(buf,""); |
|
- | 1721 | } |
|
- | 1722 | } |
|
1709 | setvar(p1,""); |
1723 | else setvar(p1,""); |
1710 | } |
1724 | } |
1711 | } |
1725 | } |
1712 | 1726 | ||
1713 | /* exchange the values of two variables */ |
1727 | /* exchange the values of two variables */ |
1714 | void exec_exchange(char *p) |
1728 | void exec_exchange(char *p) |