![]() |
Forum Index : Microcontroller and PC projects : Apparent Bug in BASIC 5.05.03
![]() ![]() |
|||||
Author | Message | ||||
goc30![]() Guru ![]() Joined: 12/04/2017 Location: FrancePosts: 435 |
I know that for disable "option ram" you must use "option flash". That is not THE problem. Problem is that in user manual it is said that "option ram" load program in ram not only data, but in fact, all program is in flash, not in RAM. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
No it isn't. It is just the text in the memory command that is misleading - I'll fix that in the next beta. Use MM.INFO(PROGRAM) to see where the program is stored |
||||
goc30![]() Guru ![]() Joined: 12/04/2017 Location: FrancePosts: 435 |
I am sorry but I have only documents to know how to use functions. Have-you seen my post in "CMM2 next step"?? my wish I have an other problem. it is with "ARC" function some times my program stop with an error (Error radial) I give you my program Dim t%, x%, y%, r%, red%, green%, blue%, c%, b% Dim x1%,y1%,la% Dim x2%,y2% dim timtot as float dim integer maxx dim integer maxy Dim vtim As float dim INTEGER elx(61), ely(61), elxd(61), elyd(61) , elxe(61), elye(61) dim integer elc, elf, elxp, elyp,eli2,eli1 dim float ela, els, ele, sine, cosine,el1 dim i as integer dim j as integer dim n as integer dim txt1$ as string dim txt2$ as string Dim nbx% maxx=MM.VRES-1 maxy=mm.hres-1 nbx%=300 timtot=0 '---- test 26 : draw x arcs color and 1pixel width CLS RGB(black) txt1$="Arcs function (1 pixel) test in" writtitle(txt1$) Timer=0 For i%=1 To nbx% x%=Rnd()*maxx y%=Rnd()*maxy x1%=Rnd()*maxx y1%=Rnd()*maxy c%=Rnd()*&hffffff els=rnd()*360 'random size ela=rnd()* 360 'random angle Arc x%,y%,x1%,,els,ela,c% Next i% vtim=Timer/1000: timtot=timtot+vtim writresult(vtim) '---- test 27 : draw x arcs color and rnd pixel width CLS RGB(black) txt1$="Arcs function (x pixels) test in" writtitle(txt1$) Timer=0 For i%=1 To nbx% x%=Rnd()*maxx y%=Rnd()*maxy x1%=Rnd()*maxx y1%=x1%+(Rnd()*30) if y1%=x1% then y1%=x1%+1 c%=Rnd()*&hffffff els=rnd()* 360 'random start arc ela=rnd()* 360 'random end arc 'print els, ela 'if els>ela then el1=ela:ela=els:els=el1 Arc x%,y%,x1%,y1%,els,ela,c% Next i% vtim=Timer/1000: timtot=timtot+vtim writresult(vtim) end sub writtitle(tx as string) local tx1$ tx1$="Test "+str$(n)+" "+tx+" " tx1$=left$(tx1$,50) Print tx1$; end sub sub writresult(t1 as float) Print Str$(t1,2,3,"0")+" Seconds" 'Pause(ttp) end sub Edited 2020-08-01 17:46 by goc30 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Try adding this line before each ARC command if abs(els-ela) < 1 then els = ela+1 The starting and ending arcs are too close to each other. I am not sure what the minimum is but a value of 1 seems to work reliably. Jim VK7JH MMedit |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
This happens when the integer value of the radials is the same i.e. it is not an arc. The error is correct your program should check for the angles being the same before making the ARC call Sorry but I can't do anything about this. The battery backed area of RAM I use for options is completely full |
||||
goc30![]() Guru ![]() Joined: 12/04/2017 Location: FrancePosts: 435 |
in first time I have think that your response is good, but if I print values they give for exemple 340,126 and 340.855. values are float type, I think that is not equal, but maybe you work only with integer value you don't work with bits for "on/off" parametres ? Edited 2020-08-01 18:26 by goc30 |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |