Thu, 08 Jul 2010 21:07:25 GMTDecimal BASIC とBASIC Acceleratorの開発に関する掲示板です。
https://osdn.net/projects/decimalbasic/forums/
Forum: 公開討議 - Thread: Compiled program does not run - Decimal BASIC Open Source Project on OSDNja-jpThu, 08 Jul 2010 21:07:25 GMTukimikuRE: Compiled program does not run
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51845
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51845Thank you very much for explaining these details. I now know how to handle the most important differences, I think.Tue, 06 Jul 2010 23:56:50 GMTSHIRAISHI KazuoRE: Compiled program does not run
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51806
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51806BASICAcc does not response while executing, it happens to seem to hang up. Tue, 06 Jul 2010 23:44:30 GMTSHIRAISHI KazuoRE: Compiled program does not run
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51804
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51804The evaluation precisions of the fundamental four operations is 56 bits for Decimal BASIC binary mode, but may perhaps be 64bits for BASICAcc. Tue, 06 Jul 2010 22:25:08 GMTSHIRAISHI KazuoRE: Compiled program does not run
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51802
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51802 Decimal BASIC has the similar option of character set.
Decimal BASIC Japanese version assumes UTF-8 but English version does not.
BASICAcc has no distinction of Japanese edition or English edition, so the option of character set is set to the safe side.
BASICAcc and Decimal BASIC are both in accordance with the Full BASIC standard, and have many incompatibility with the standard in common, but BASICAcc and Decimal BASIC are not completely identical in their behavior. For example, their binary numerical operations may have slight differences.
Tue, 06 Jul 2010 17:23:23 GMTukimikuRE: Compiled program does not run
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51798
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51798Thanks. So do I understand correctly that the interpreter does not assume UTF-8 but the compiler does? Are there more such differences I should be aware of?
Regards,Mon, 05 Jul 2010 23:45:25 GMTSHIRAISHI KazuoRE: Compiled program does not run
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51770
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51770The program will probably run, but it may take tremendous hours, becuase the character set is UTF-8.
You can change the character set to BYTE selecting "Character set" "Byte" on the "behavior" tab in the Option-Compatibility menu.
You can also add a statement
OPTION CHARACTER BYTE
at the first of the program.
Mon, 05 Jul 2010 18:45:49 GMTukimikuCompiled program does not run
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51768
https://osdn.net/projects/decimalbasic/forums/16168/26751/#forum-message-51768Dear Mr.
The following program code (looking for the prime below 1000000 that can be written as the sum of the most primes) runs fine in the interpreter of DECIMAL BASIC (7.4.6), but does not do anything in the compiled version. Maybe you would like to look into this? I have no ideas as to where the problem may be since the program does not display anything.
Thank you.
Regards.
--- snip ---
LET n_primes = 1000000
DIM primes(n_primes)
LET primes$=REPEAT$("p", n_primes)
LET primes$(1:1) = "-"
LET n = 2
LET count = 0
DO
LET count = count + 1
LET primes(count) = n
LET primes$(n:n) = "p"
FOR i = n + n TO n_primes STEP n
LET primes$(i:i) = "-"
NEXT i
LET found = 0
FOR i = n+1 TO n_primes
IF primes$(i:i) = "p" THEN
LET n = i
LET found = 1
EXIT FOR
END IF
NEXT i
LOOP UNTIL found = 0
PRINT count; "primes below 1000000 found"
PRINT "Now summing up..."
PRINT
REM finding the prime below 1000000 expressable as the sum of most consecutive primes
LET pcount_max = 0
LET p_max = 0
FOR pn = 2 TO count
LET p = primes(pn)
FOR index = 1 TO pn - 1
LET sum = 0
LET i = index - 1
DO WHILE sum < p
LET i = i + 1
LET sum = sum + primes(i)
LOOP
IF sum = p THEN
LET primes_used = i - index + 1
IF primes_used > pcount_max THEN
LET pcount_max = primes_used
LET p_max = p
PRINT p; "written as sum of"; primes_used; "primes."
EXIT FOR
END IF
END IF
NEXT index
NEXT pn
END
--- snip ---