|
Post by Walt Decker on Dec 31, 2022 8:42:16 GMT -5
|
|
|
Post by Walt Decker on Jan 2, 2023 16:46:07 GMT -5
' SS.LEFT = HEXDEC("&H00000000") SS.CENTER = HEXDEC("&H00000001") SS.RIGHT = HEXDEC("&H00000002") SS.SIMPLE = HEXDEC("&H0000000B") SS.NOPREFIX = HEXDEC("&H00000080") SS.NOTIFY = HEXDEC("&H00000100") SS.CENTERIMAGE = HEXDEC("&H00000200") SS.SUNKEN = HEXDEC("&H00001000")
Style$ = "SS.CENTER,SS.CENTERIMAGE,SS.SUNKEN"
Value = 0 FOR I = 1 TO 3 Value = Value OR EVAL(WORD$(Style$, I, ",")) NEXT I '
Anyone else?
|
|
gaslouk
Full Member
Hi from beautiful Greece.
Posts: 130
|
Post by gaslouk on Jan 3, 2023 1:01:58 GMT -5
Happy new year. I modified the Liberty basic help example a bit to see the result
a$(0) = "zero 00" a$(1) = "one 11" a$(2) = "two 22" a$(3) = "three 33" a$(4) = "four 44" a$(5) = "five 55" a$(6) = "six 66" a$(7) = "seven 77" a$(8) = "eight 88" a$(9) = "nine 99"
b$(0) = "0" b$(1) = "1" b$(2) = "2" b$(3) = "3" b$(4) = "4" b$(5) = "5" b$(6) = "6" b$(7) = "7" b$(8) = "8" b$(9) = "9"
for i=0 to 9 code$ = "a$(i)" code1$ = "b$(i)" print "We will evaluate the code: "; code$; code1$ result$ = eval$(code$) result1$ = eval$(code1$) print result$, result1$ 'Now let's use the eval function, which effectively does a 'val() to the result of the calculation. Converting a non 'numeric string to a numeric value results in zero. result = eval(code$) result1 = eval(code1$) print result, result1 next i
And here are the results. We will evaluate the code: a$(i)b$(i) zero00 0 0 0 We will evaluate the code: a$(i)b$(i) one11 1 0 1 We will evaluate the code: a$(i)b$(i) two22 2 0 2 We will evaluate the code: a$(i)b$(i) three33 3 0 3 We will evaluate the code: a$(i)b$(i) for44 4 0 4 We will evaluate the code: a$(i)b$(i) five55 5 0 5 We will evaluate the code: a$(i)b$(i) six66 6 0 6 We will evaluate the code: a$(i)b$(i) seven77 7 0 7 We will evaluate the code: a$(i)b$(i) eight88 8 0 8 We will evaluate the code: a$(i)b$(i) nine99 9 0 9 Gaslouk
|
|
|
Post by Walt Decker on Jan 3, 2023 9:23:23 GMT -5
I notice you are only using EVAL. What will the result be if you use both EVAL() and EVAL$()?
|
|
gaslouk
Full Member
Hi from beautiful Greece.
Posts: 130
|
Post by gaslouk on Jan 3, 2023 9:31:46 GMT -5
I notice you are only using EVAL. What will the result be if you use both EVAL() and EVAL$()? Both are in use Walt.
|
|
|
Post by Walt Decker on Jan 3, 2023 13:18:49 GMT -5
I am sorry. I did not see the EVAL$() in the code, and the print out of the result did not make it obvious. I will pay more attention in the future.
Can you come up with something else using EVAL(), EVAL$(), perhaps branching to another routine based on the returned value?
|
|