News:

Please note new Forum URL: forum.designcad.com

Main Menu

Is BasicCAD broken

Started by Gymbo, April 23, 2025, 09:42:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gymbo

Or is it DesignCAD 2D 2022?

sys(800) = 1
break->

s = 52453
x1 = (s * _pi_)
x1 = sqrt(x1)
y1 = int(x1)
z1 = (x1 - y1)
end


I ran this little test program without the end statement, and it performed flawlessly.

I added the end statement, ran it again and it  froze at the first x1 line, that line was not printed on the debug window.

Again w/o the end, fine.

Again with the end, fine. It fails with the end statement about half the time.
Regards,

Jim

Gymbo

More info. This is the code that started this, part of a subroutine:

sys(800) = 2
Break->

milli = sec * 1.6 / 100

seed = hr * 3600 + min * 60 + sec + milli * i^2
'approx seconds since midnight
s(i) = seed
print s(i)*_pi_
anykey
x1 = sqrt(s(i) * _pi_)
y1 = int(x1)
z1 = (x1 - y1)   

Return


The print and anykey statements were added for trouble shooting.
It still freezes at the x1 = line, but it doesn't print s(i)*_pi_


Regards,

Jim

Rob S

#2
I was hoping one of the macro gurus would tackle this one...

It fails for me on latest 3d max as well

Well, actually it runs for me with the "end" statement included, tried now V2020, V2022, and V2025 beta, where it failed once, may be user error.
User since forever

Gymbo

Yeah, replaced "_pi_" with 3.142 and it worked. Must bee a problem with pi.
Regards,

Jim