Fóruns: Forum of Decimal BASIC (Thread #40076)

Paract BASIC Error (2018-10-19 23:26 by toml_12953 #82069)

The following program works fine in Decimal BASIC 7.8.5 but gives a divided by zero error in Paract BASIC

DECLARE EXTERNAL FUNCTION FN_split$

PRINT FN_split$( "gHHH5YY++///\" )
END

EXTERNAL FUNCTION FN_split$(s$)
LET c$ = s$(1:1)
LET split$ = ""
FOR i = 1 TO LEN(s$)
LET d$ = s$(i:i)
IF d$ <> c$ THEN
LET split$ =split$ & ", "
LET c$ = d$
END IF
LET split$ = split$ & d$
NEXT i
LET FN_split$ = split$
END FUNCTION
(Last Update: 2018-10-19 23:27 by toml_12953)

Responder a #82069×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: Paract BASIC Error (2018-10-23 10:32 by Shiraishi Kazuo #82074)

I could not reproduced the error.
Confirm the version of Lazarus or so,
and try the following to identify the statement that causes the error.

100 DECLARE EXTERNAL FUNCTION FN_split$
110 PRINT FN_split$( "gHHH5YY++///\" )
120 END
130 EXTERNAL FUNCTION FN_split$(s$)
140 DEBUG ON
150 TRACE on
160 LET c$ = s$(1:1)
170 LET split$ = ""
180 FOR i = 1 TO LEN(s$)
190 LET d$ = s$(i:i)
200 IF d$ <> c$ THEN
210 LET split$ =split$ & ", "
220 LET c$ = d$
230 END IF
240 LET split$ = split$ & d$
250 NEXT i
260 LET FN_split$ = split$
270 END FUNCTION
Responder a #82069

Responder a #82074×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Re: Paract BASIC Error (2018-10-24 10:47 by toml12953 #82075)

Reply To Message #82074
> I could not reproduced the error.
> Confirm the version of Lazarus or so,
> and try the following to identify the statement that causes the error.

The problem was the beta version of Lazarus 2.0 RC1. When I switched back to Lazarus 1.84
the problem went away. You may want to check the beta version in case the release of 2.0 breaks your compilers.

Responder a #82074

Responder a #82075×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login