Search found 356 matches

by sancho3
Dec 27, 2018 1:17
Forum: Tips and Tricks
Topic: Fast clipping lines in BASIC.
Replies: 19
Views: 3235

Re: Fast clipping lines in BASIC.

I remember this code from way back in another thread and it is the fastest I have seen. There is an anomaly that is very minor but may impact the way this is used. The outputed line does not always match that which comes from the Line command. You can see the artifacts left using this code: screenre...
by sancho3
Dec 23, 2018 0:13
Forum: Projects
Topic: Simple Font-Library
Replies: 11
Views: 2737

Re: Simple Font-Library

I just want to add that I tried it with FBC32 on Ubuntu and FBC64 and no crashes. However changing the depth to 16 or 32 does freeze the program on keypress to exit. The problem narrows down to the line in font.bi and the load function: Get fntimg,(wholewide,0)-(wholewide+wide(i)-1,size-1),Char(i) I...
by sancho3
Dec 22, 2018 8:56
Forum: Projects
Topic: Simple Font-Library
Replies: 11
Views: 2737

Re: Simple Font-Library

Oh sorry, I didn't see that part of your post.
I just tried it with sans (on Ubuntu and it worked fine as does serif.
Perhaps sans.fnt is corrupt. Mine is 927 bytes.
by sancho3
Dec 22, 2018 6:29
Forum: Projects
Topic: Simple Font-Library
Replies: 11
Views: 2737

Re: Simple Font-Library

I'm on Ubuntu and your code works fine. Where is the error message getting "Free()" from? That function is not in any of the files. Also make sure that the program is finding 'mono.fnt'. There is no error message or return value to indicate if load worked (BadIdea I recommend some kind of ...
by sancho3
Dec 21, 2018 8:22
Forum: Beginners
Topic: Array pointer assignment
Replies: 26
Views: 2021

Re: Array pointer assignment

In the case UEZ presents, the copy constructor is not necessary as you have shown, FXM. Good to know, but isn't the implicit copy limited to simple intrinsic types only? If you were to add in some pointers or managed memory, then the copy constructor becomes necessity. At that point you can't rely o...
by sancho3
Dec 21, 2018 3:17
Forum: Beginners
Topic: Array pointer assignment
Replies: 26
Views: 2021

Re: Array pointer assignment

Nearly always people have an absolute need for speed when copying arrays. On the occasion that it is not important I suggest wrapping the array in a type and giving yourself more options. Here is a type that offers four methods of copying an array. All four use the same for next loop. IMHO I like th...
by sancho3
Dec 21, 2018 2:41
Forum: Community Discussion
Topic: adding FreeBASIC to the TIOBE index
Replies: 38
Views: 4513

Re: adding FreeBASIC to the TIOBE index

I have never heard of TIOBE before either. Is there a reason/benefit to be mentioned there? I doubt that programmers or potential programmers are visiting the site to decide on a language. On a side note lets look at the massive mistake made by MS when they dropped VB and switched to Dot Net. 20 yea...
by sancho3
Dec 21, 2018 2:22
Forum: Community Discussion
Topic: Nominations for Forum Moderators
Replies: 70
Views: 9579

Re: Nominations for Forum Moderators

Congratulations Imortis, and thank you for stepping up to the plate.
by sancho3
Dec 20, 2018 3:28
Forum: Tips and Tricks
Topic: Fast track an array of points.
Replies: 4
Views: 722

Re: Fast track an array of points.

Interesting trick/tip.
I took a brief look at the code. Are you cycling through all possible paths and choosing the shortest?
by sancho3
Dec 18, 2018 2:46
Forum: Tips and Tricks
Topic: Type FixLenStr (fixed size String Type)
Replies: 3
Views: 713

Re: Type FixLenStr (fixed size String Type)

I recommend overloading at least the Cast/String so that one could use simply:
? myfixlenstr

I would also add the &, Let, and any other that are available to the built in fixed length string.
by sancho3
Dec 17, 2018 1:50
Forum: Tips and Tricks
Topic: Concatenate 2 arrays using operator & and Union
Replies: 6
Views: 989

Re: Concatenate 2 arrays using operator & and Union

I am not %100 sure where your latest code fails. Here is a way to accomplish the concatenation of two n sized arrays using the string concat operator & or the + operator via explicit cast. It uses operator new[] to create enough memory for the new array. I have no idea if there is speed gains ov...
by sancho3
Dec 15, 2018 5:05
Forum: Tips and Tricks
Topic: Concatenate 2 arrays using operator & and Union
Replies: 6
Views: 989

Re: Concatenate 2 arrays using operator & and Union

Nice job Tourist, You can remove the warnings with a cast: 'change the arrays content into plain integers dim as uinteger<4*8> ptr uiptr1 uiptr1 = Cast(uinteger<32> ptr, @bytearray1(0)) '' *uiptr eats the byte array on its 4bytes integer length dim as uinteger<4*8> ptr uiptr2 uiptr2 = Cast(uinteger<...
by sancho3
Dec 14, 2018 5:09
Forum: Tips and Tricks
Topic: Insert/Replace String procedures
Replies: 38
Views: 3223

Re: Insert/Replace String procedures

@wq1980
I just tested it with same length replace strings and it works fine.
My guess is your file is unicode.
by sancho3
Dec 12, 2018 4:29
Forum: Tips and Tricks
Topic: Insert/Replace String procedures
Replies: 38
Views: 3223

Re: Insert/Replace String procedures

In my opinion the tricky part is in the fact that you can't deallocate the memory until after the user has gotten and dealt with the result string. There is no way for the function to know when that happens. So do we devise a running list of pointers to new memory each time replace is called? I don'...

Go to advanced search