FbCadCam - Macro (Discussion)
#1
I can't and wouldn't post the entire source code in the forum as it has 27931 LOC.

The most recent source code for fbcadcam-macro is at http://fbcadcam.org/gtk3/source_code/myf...-macro.bas
Reply
#2
you can probably post the 27k loc as an attachment.

however, i was going to suggest that this is a great place to put actual documentation. i will understand if the website comes first, i know i have a link to that documentation somewhere. (actually posting it here would be excellent.) one thing at a time, of course; more if you prefer.
Reply
#3
I'm working in part on the documentation of it on this forum in the section:

Other programming languages / freebasic / freebasic projects.

A complete documentation of it in one shot is my overall goal however the program is written incredibly inefficient. It's a complete poor mans approach if you will.

Once I figure out how to rewrite it correctly then a whole new documentation of how it works would need to be written.

Having discussions about it in two different sections in the forum can get difficult to sort out.
Maybe it should be moved to one section by Walter if he agrees.
Reply
#4
i will go ahead and request that it be moved here.

if you protest, it will probably be moved there again.
Reply
#5
That's fine. Request it be moved here.
Reply
#6
There is a problem with using or trying to compile fbcadcam-macro.bas by itself.
http://fbcadcam.org/gtk3/source_code/myf...-macro.bas
This version of fbcadcam-macro uses variables and functions from fbcadcam.bas.

If you comment out the code inside the sub routines "line", "circle", "copy" "rotate" etc.. and replace them with your own routines then it should be fine.

If however someone wants to try and compile it as is then there is also the matter of fbcadcam.bas using functions and variables from gtk. so the entire thing (gtk+3, fbcadcam.bas, fbcadcam-macro.bas, icons and graphics etc...) need to be downloaded.

As an alternative, fbcadcam-macro.bas (all by itself) is available for download @
http://fbcadcam.org/fbcadcam-macro/

This older version (original version) did not have anything specific to do with fbcadcam.
It may be error prone as I haven't updated it in awhile.
Reply
#7
I just uploaded a video of fbcadcam-macro.bas in action
https://youtu.be/ZHyQ4KuX_yY


Attached Files Thumbnail(s)

.zip   Nano3-2 pack.zip (Size: 11.13 KB / Downloads: 3)
Reply
#8
fbcadcam-macro with string evaluation work in progress.
prior, this freebasic interpreter (well, partial interpreter) did not accept and or evaluate strings.
you can find my work in progress source code (bas files) at fbcadcam.org/fbcadcam-macro/
http://fbcadcam.org/fbcadcam-macro/fbcad...ings-1.bas
http://fbcadcam.org/fbcadcam-macro/fbcad...ings-2.bas is the latests as of this post.

this program interprets 'test.bas'
for example create and save test.bas in the same directory and run fbcadcam-macro-with-strings.bas

example that should work in versing 2
'test.bas:
dim as string a,b
a="hello world"
print a
b=a
print b

This is a work in progress.
There are many string commands in freebasic.
At the moment I have added CHR and STRING
At the moment I have not added string concatenation (ie. c=a+b or c=a&b)
pending LEN, INSTR, MID, LEFT, LTRIM, etc...
Reply
#9
Well it took me a bit more time to finish adding the string variable to fbcadcam-macro.bas but it is working now.

To see it in action, down load the latest release of fbcadcam.
If you run this simple example macro, you should see characters A thru Z plotted in the drawing area.

Code:
Dim As Integer i
For i = 1 to 26
   Text 10,i*20,5,10,Chr(i+64)
Next

[Image: fbcadcam-gtk_screenshot_10-08-2017-1.png]

FbCadCam-Macro now supports the following Freebasic.net operators and functions:

Arithmetic_op_cmd_c=9
+
-
*
/
\
^
Mod
Shl
Shr

Bitwise_op_cmd_c=8
Not
And
Or
Eqv
Imp
Xor
AndAlso
OrElse

Math_dtc_op_cmd_c=31
CByte
CUByte
CShort
CUShort
CLng
CULng
CInt
CUInt
CLngInt
CULngInt
CSign
CUnsg
CSng
CDbl
Cbool
Abs
ACos
ASin
ATan2
Atn
Cos
Exp
Fix
Frac
Int
Log
Rnd
Sgn
Sin
Sqr
Tan

String functions
Chr
Str
Lcase
Ucase
String
Space
Right
Left
Mid
Trim
Ltrim
Rtrim
Instr
Instrrev
Len
Asc
Val
&
+
Reply
#10
Congratulations Owen!

I am sure this was a major effort and accomplishment for you (it would be for me!) and you say you are still working AND you had a hurricane to clean up after AND... did you say if you were married?

If you are married, I will worry if any time is left for the wife? (as I do with Walter). Then again I may have a misunderstanding of marriage ie EITHER your hobby(s) OR your family relationships... sorry wandering off topic.

Having worked a very little bit with interpreters, I know adding Strings is like adding a whole new dimension, a major effort not quite as bad as getting started, but up there.
B += x
Reply
#11
thanks bplus.
my wifes would say im married to my work and hobbies and im guilty as charged.
Reply