Search found 656 matches

by owen
Sat May 23, 2020 3:57 pm
Forum: FBS (freeBASIC script)
Topic: str replace function that works in fbs
Replies: 0
Views: 3

str replace function that works in fbs

Declare Function str_replace(replace_this As String, with_this As String, in_this As String) As String Function str_replace(replace_this As String, with_this As String, in_this As String) As String Dim As Integer x, lort Dim As String new_string lort = Len(replace_this) x = InStr(in_this, replace_t...
by owen
Tue Feb 25, 2020 3:20 pm
Forum: FBS (freeBASIC script)
Topic: fbs_online_interpreter
Replies: 1
Views: 4330

Re: fbs_online_interpreter

Due to obvious security issues testing the online interpreter is available only by special request.
by owen
Tue Jan 14, 2020 6:24 am
Forum: freeBASIC code examples
Topic: my 3d game
Replies: 0
Views: 5700

my 3d game

trying to learn how to do 3d move the mouse use the arrow keys and other keys a,z,r,f,y,h,u,j,i,k, Type pt3d x As Integer y As Integer z As Integer End Type Type proj2d x As Integer y As Integer End Type Type camera x As Double y As Double z As Double xyrot As Double xzrot As Double yzrot As Double ...
by owen
Fri Jan 10, 2020 4:05 am
Forum: freeBASIC code examples
Topic: bezier
Replies: 16
Views: 4273

Re: bezier

multiple control points Type point2d x As double y As double End Type Type bezier as integer n=-1 pt(any) As point2d 'anchors and control points (p0 thru pN) declare sub append_pt(x as double, y as double) declare sub delete_pt(d as integer) declare sub plot(pres as integer) End Type sub bezier.appe...
by owen
Sun Jan 05, 2020 8:38 am
Forum: freeBASIC code examples
Topic: bezier
Replies: 16
Views: 4273

Re: bezier

snap to nearest point on the curve Type point2d x As double y As double End Type Type my_bezier_curve_udt a As point2d 'point A the curve start b As point2d 'point B the curve end c As point2d 'point C the curve control d As double 'distance to nearest point on the curve n As point2d 'nearest point ...
by owen
Thu Jan 02, 2020 2:33 am
Forum: Community Discussion
Topic: 2020 ideas
Replies: 0
Views: 5727

2020 ideas

I will try to add Bézier curves as an entity type to FbCadCam
by owen
Wed Jan 01, 2020 6:03 am
Forum: freeBASIC code examples
Topic: bezier
Replies: 16
Views: 4273

Re: bezier

curve tracks the mouse pointer Type point2d x As Integer y As Integer End Type Type my_bezier_curve_udt a As point2d 'point A the curve start b As point2d 'point B the curve end c As point2d 'point C the curve control p_res As Double 'the plotted resolution Declare Sub plot() End Type Sub my_bezier_...
by owen
Sun Dec 08, 2019 8:05 am
Forum: freeBASIC code examples
Topic: Generating folder/files
Replies: 10
Views: 3946

Re: Generating folder/files

fixed lower case for folder name Dim as string FName Dim as string MName Dim as string LName Dim as string Div Dim as string Rate Dim as string SRank Dim as string SQual Dim as string Smm Dim as string Syy Dim as string ERank Dim as string EQual Dim as string Emm Dim as string Eyy Dim as string foru...
by owen
Sun Dec 08, 2019 7:53 am
Forum: freeBASIC code examples
Topic: Generating folder/files
Replies: 10
Views: 3946

Re: Generating folder/files

Dim as string FName Dim as string MName Dim as string LName Dim as string Div Dim as string Rate Dim as string SRank Dim as string SQual Dim as string Smm Dim as string Syy Dim as string ERank Dim as string EQual Dim as string Emm Dim as string Eyy Dim as string forumurl, T Dim as string folder Dim...
by owen
Sun Dec 08, 2019 7:05 am
Forum: freeBASIC code examples
Topic: Generating folder/files
Replies: 10
Views: 3946

Re: Generating folder/files

i replaced the + with ; in some of the lines of code for example in the html TITLE Dim as string FName Dim as string MName Dim as string LName Dim as string Div Dim as string Rate Dim as string SRank Dim as string SQual Dim as string Smm Dim as string Syy Dim as string ERank Dim as string EQual Dim ...
by owen
Sat Dec 07, 2019 8:44 pm
Forum: freeBASIC code examples
Topic: Generating folder/files
Replies: 10
Views: 3946

Re: Generating folder/files

notice in the code above how i use chr(34)? that prints a quotation mark

now all u got to do is include the variables in the html section of code where appropriate
by owen
Sat Dec 07, 2019 8:43 pm
Forum: freeBASIC code examples
Topic: Generating folder/files
Replies: 10
Views: 3946

Re: Generating folder/files

and here's an example with the html in it Dim as string FName Dim as string MName Dim as string LName Dim as string Div Dim as string Rate Dim as string SRank Dim as string SQual Dim as string Smm Dim as string Syy Dim as string ERank Dim as string EQual Dim as string Emm Dim as string Eyy Dim as st...
by owen
Sat Dec 07, 2019 8:20 pm
Forum: freeBASIC code examples
Topic: Generating folder/files
Replies: 10
Views: 3946

Re: Generating folder/files

here is an example of how easy it is to make this program Dim as string FName Dim as string MName Dim as string LName Dim as string Div Dim as string Rate Dim as string SRank Dim as string SQual Dim as string Smm Dim as string Syy Dim as string ERank Dim as string EQual Dim as string Emm Dim as stri...
by owen
Sat Dec 07, 2019 7:57 pm
Forum: freeBASIC code examples
Topic: Generating folder/files
Replies: 10
Views: 3946

Re: Generating folder/files

simple way 'create a folder and write a file in it dim as string foldername="test" dim as string filename="test.txt" dim as string folderandfile=foldername+"\"+filename mkdir(foldername) open folderandfile for output as #1 print #1, "asdf" close #1 'test to see if it worked dim as string s open fold...
by owen
Sat Dec 07, 2019 6:38 pm
Forum: freeBASIC code examples
Topic: Generating folder/files
Replies: 10
Views: 3946

Re: Generating folder/files

Ok continue to post the rest of your code in here so I can help u make this program
by owen
Mon Sep 23, 2019 2:56 pm
Forum: FBS (freeBASIC script)
Topic: time out and abort
Replies: 1
Views: 2173

Re: time out and abort

In the event of an error trying to figure out if the error is caused by The Script or The Interpreter... Well here's what you can do. First verify that you can compile your script with the free basic compiler. If it compiles without errors then more than likely the error is caused by The Interpreter...
by owen
Mon Sep 23, 2019 5:38 am
Forum: FBS (freeBASIC script)
Topic: time out and abort
Replies: 1
Views: 2173

time out and abort

i added a run time limit of 3 seconds and an abort on error feature the interpreter will exit if it takes to longer then 3 seconds in do loops and for next loops. in order to allow the interpreter to run longer then 3 seconds adjust the value of the time_out variable in the init sub routine. if ther...
by owen
Mon Sep 23, 2019 4:49 am
Forum: FbCadCam Philippines progress reports 9/18 to 9/19
Topic: 1 year
Replies: 1
Views: 4042

Re: 1 year

My hope for FbcadcamPH is that the company be given to the kids.
by owen
Mon Sep 23, 2019 4:43 am
Forum: FBS (freeBASIC script)
Topic: File i/o
Replies: 1
Views: 2155

Re: File i/o

Files can be opened using access modes:
Input
Output
Append
Binary

Note: random access mode is not available as of this post.
by owen
Sat Sep 21, 2019 3:53 am
Forum: FBS (freeBASIC script)
Topic: What is fbs
Replies: 1
Views: 2171

Re: What is fbs

Writing fbcadcam_macro (now called fbs {my own freeBASIC script interpreter} ) has been and still is quite the adventure. Originally the interpreter was written for fbcadcam in order to draw programmatically in fbcadcam similar to the idea of autocad's LISP feature to draw programmatically in AutoCA...
by owen
Fri Sep 20, 2019 5:31 am
Forum: FbCadCam Philippines progress reports 9/18 to 9/19
Topic: 1 year
Replies: 1
Views: 4042

1 year

i ran out of funds to keep the Philippines project going and they haven't been able to generate enough revenue to keep it going on their own so it might get kinda quite in here for awhile.
if anyone would like to donate funds please contact me at 4076558537 opreese at gmail
by owen
Thu Sep 19, 2019 7:42 pm
Forum: FBS (freeBASIC script)
Topic: File i/o
Replies: 1
Views: 2155

File i/o

I added file i/o functions:
Open
Close
Eof
Lof
Freefile
Input #
Line Input #
Print #
Get #
Put #

For example:
Dim a string s
Dim as integer i
Open 'file_name.txt" for input as #1
Do While Not Eof(1)
Input #1, i, s
Print i, s
Loop
Close #1
by owen
Sat Sep 07, 2019 2:28 pm
Forum: FBS (freeBASIC script)
Topic: ByVal ByRef
Replies: 0
Views: 4128

ByVal ByRef

Fbs aka fbcadcam-macro passes all variables including arrays ByVal.

There is no need to specify ByVal in a sub routine or function declaration. In fact I think doing that will cause it to crash.
by owen
Fri Sep 06, 2019 1:06 pm
Forum: FBS (freeBASIC script)
Topic: update 9-5-19
Replies: 1
Views: 2347

Re: update 9-5-19

this is a test for sub routines and functions http://fbcadcam.org/fbs/test_subs_functs.fbs test_subs_functs.fbs #!/usr/bin/perl print "Content-type: text/html\n\n"; system("./fbs test_subs_functs.bas"); test_subs_functs.bas Declare Sub init(document_title As String) Declare Function build_html(docum...