{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "Help Head ing" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "Tim es" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE " " -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 0 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Error" 7 8 1 {CSTYLE "" -1 -1 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "M aple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Bullet Item" 0 15 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 3 3 0 0 0 0 0 0 15 2 }} {SECT 0 {SECT 0 {PARA 0 "" 0 "" {TEXT 26 7 "Error: " }{TEXT -1 50 "... value in for loop must be numeric or character" }}{PARA 0 "" 0 "" {TEXT -1 53 " increment of for loop must be numeric" }} {PARA 0 "" 0 "" {TEXT -1 73 " increment when looping ov er characters must be an integer" }}{PARA 0 "" 0 "" {TEXT -1 70 " \+ final value in for loop must have same type as initial" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 33 "There are three allowed types of " }{MPLTEXT 0 21 3 "for" }{TEXT -1 13 " statem ent. " }}{PARA 15 "" 0 "" {TEXT -1 53 "The first is a loop over numer ical values, where the " }{MPLTEXT 0 21 4 "from" }{TEXT -1 2 ", " } {MPLTEXT 0 21 2 "to" }{TEXT -1 5 " and " }{MPLTEXT 0 21 2 "by" }{TEXT -1 116 " parts, if present, must evaluate to numeric values: integers , fractions or floats. Non-numeric constants such as " }{MPLTEXT 0 21 2 "Pi" }{TEXT -1 4 " or " }{MPLTEXT 0 21 7 "sqrt(3)" }{TEXT -1 46 " are not allowed: in some cases you might use " }{MPLTEXT 0 21 5 "eval f" }{TEXT -1 40 " to make such a constant into a float. " }}{PARA 15 "" 0 "" {TEXT -1 76 "The second type is a loop over character values ( strings of length 1). The " }{MPLTEXT 0 21 4 "from" }{TEXT -1 5 " and " }{MPLTEXT 0 21 2 "to" }{TEXT -1 36 " parts evaluate to characters. \+ The " }{MPLTEXT 0 21 2 "by" }{TEXT -1 41 " part, if present, must be \+ an integer. " }}{PARA 15 "" 0 "" {TEXT -1 97 "The third type is a lo op over the members of a list or set, or operands of some other expres sion." }}{PARA 0 "" 0 "" {TEXT -1 52 "These error messages arise when \+ the expression in a " }{MPLTEXT 0 21 4 "from" }{TEXT -1 4 " or " } {MPLTEXT 0 21 2 "to" }{TEXT -1 11 " part of a " }{MPLTEXT 0 21 3 "for " }{TEXT -1 46 " statement does not result in a value of type " } {MPLTEXT 0 21 7 "numeric" }{TEXT -1 19 " or a character (a " } {MPLTEXT 0 21 6 "string" }{TEXT -1 172 " of length 1). The allowed nu meric values are integers, fractions and floats. If the actual value \+ is a real constant but not an integer, fraction or float, you could us e " }{MPLTEXT 0 21 5 "evalf" }{TEXT -1 25 " to make it into a float." }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 9 "Examples:" }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 33 "for i from a to 3 do print(i) od;" }}{PARA 8 " " 1 "" {TEXT -1 62 "Error, initial value in for loop must be numeric o r character\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "for i from 1 to sqrt(10) do print(i) od;" }}{PARA 8 "" 1 "" {TEXT -1 60 "Error, \+ final value in for loop must be numeric or character\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "for i from 1 to evalf(sqrt(3)) by s qrt(2) do print(i) od;" }}{PARA 8 "" 1 "" {TEXT -1 45 "Error, incremen t of for loop must be numeric\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "for i from evalf(sqrt(2)) to evalf(sqrt(10)) by evalf(sqrt(3)) do print(i)\nod;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+iN@99!\"*" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+qVEYJ!\"*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "for i from \"a\" to \"z\" by 1/2 do print(i) od; " }}{PARA 8 "" 1 "" {TEXT -1 65 "Error, increment when looping over ch aracters must be an integer\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "for i from 1 to \"d\" do print(i) od;" }}{PARA 8 "" 1 "" {TEXT -1 62 "Error, final value in for loop must have same type as initial\n " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "for i in F(a,b,c) do pr int(i) od;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"aG" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#%\"bG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"cG" }}}} {SECT 0 {PARA 0 "" 0 "" {TEXT 26 10 "See also: " }{HYPERLNK 17 "for" 2 "repetition" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "evalf" 2 "evalf" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "numeric" 2 "type/numeric" "" }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 22 "Maple Advisor Database" }{TEXT 256 18 " R. Israel, 1997" }}}}{MARK "1 5 0 0" 44 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }