Search found 309 matches

by sancho3
Dec 08, 2018 1:58
Forum: General
Topic: How to fix error 177 ???
Replies: 40
Views: 554

Re: How to fix error 177 ???

@mrminecrafttnt There is another alternative that I like to use. When there is a chance that a function may return an unusable result, set it up as a boolean return value and use either a pointer to the desired return type or a byref parameter. Return true when the return value is valid and false wh...
by sancho3
Dec 03, 2018 3:42
Forum: Tips and Tricks
Topic: Get String Characters 4x Faster than Mid()
Replies: 83
Views: 1605

Re: Get String Characters 4x Faster than Mid()

Nice tip Munair: Using a union is even faster from what I can see. #define StrNOf(s, n) strptr(s)[n] type char as string * 1 Union uchar As String * 1 s As Ubyte c End Union dim as string s1 = "Hello test 2" dim as char c dim as double t dim As uchar uc print "by union:" t = time...
by sancho3
Dec 02, 2018 22:57
Forum: General
Topic: Too restrictive compilation control on dynamic arrays in the main code?
Replies: 28
Views: 496

Re: Too restrictive compilation control on dynamic arrays in the main code?

Haubitze wrote:what, why not? ;D

Because the colon operator ':' separates command lines. The left side is one line, the right another.
Bear in mind that you could write an entire FreeBASIC program on one line using the colon.
by sancho3
Nov 27, 2018 6:34
Forum: General
Topic: Is there existing an inputroutine?
Replies: 28
Views: 553

Re: Is there existing an inputroutine?

@dodicat Your routine does not work with ubuntu. There is no cursor and left and right don't seem to do anything (its hard to tell because there is no cursor) @grindstone Works great except for the delete key. To replicate the problem type abcdefg, left key to 'd' and press delete. The 'd' is replac...
by sancho3
Nov 25, 2018 5:03
Forum: Tips and Tricks
Topic: quick sort in FreeBASIC faster then C-Lib
Replies: 10
Views: 379

Re: quick sort in FreeBASIC faster then C-Lib

@DJ
You are correct
by sancho3
Nov 24, 2018 7:37
Forum: Tips and Tricks
Topic: quick sort in FreeBASIC faster then C-Lib
Replies: 10
Views: 379

Re: quick sort in FreeBASIC faster then C-Lib

edit: flawed post
by sancho3
Nov 21, 2018 1:30
Forum: Tips and Tricks
Topic: Proper Case / Title Case
Replies: 9
Views: 162

Re: Proper Case / Title Case

If you change the parameter to byref then you avoid making an internal copy of the string. In fact you can change both the parameter and the return to byref. I have tested the speed of lcase in the past and it is very fast. So I am not sure if it is at all worth changing but here is your code withou...
by sancho3
Nov 18, 2018 19:47
Forum: Documentation
Topic: How to Replace Any Recursion with Simple Iteration or Unlimited Iteration with its Own Stack, in FB
Replies: 23
Views: 967

Re: How to Replace Any Recursion with Simple Iteration or Unlimited Iteration with its Own Stack, in FB

That is the macro method of implementing generic-like types. #define defines a macro. Instead of wrapping the type directly inside a macro you have the namespace. But for sure without the #define (macro) you can't isolate the type. Still the problem similar to a host of if/else. You now have a host ...
by sancho3
Nov 18, 2018 9:31
Forum: Documentation
Topic: How to Replace Any Recursion with Simple Iteration or Unlimited Iteration with its Own Stack, in FB
Replies: 23
Views: 967

Re: How to Replace Any Recursion with Simple Iteration or Unlimited Iteration with its Own Stack, in FB

@badidea: That is called generics. This is a current wishlist item for fb. The answer is no you can't, without jumping through some ugly hoops. You can try to build your list with any pointers but then you will either fill your comparison method code full of if/else (if myobject is string elseif myo...
by sancho3
Nov 18, 2018 1:56
Forum: General
Topic: WITH .. END WITH Scope
Replies: 5
Views: 185

Re: WITH .. END WITH Scope

Since this would only be a matter for variables created in the with block (and not for any other statements therein) maybe using the .. context modifier such as:

Code: Select all

With a
    ..Dim as integer n
end with
by sancho3
Nov 17, 2018 2:06
Forum: General
Topic: WITH .. END WITH Scope
Replies: 5
Views: 185

Re: WITH .. END WITH Scope

However, with objects, there are situations when with .. end with cannot be used because of its scope nature. The following snippet cannot be run, but demonstrates such a situation: Can you clarify what you mean by this? Its not immediately clear (to me) why with/end with cannot be used in the post...
by sancho3
Nov 13, 2018 7:05
Forum: Community Discussion
Topic: Forum Moderators
Replies: 19
Views: 729

Re: Forum Moderators

@Pritchard: Yes he handled that thread poorly. However, the point he was making was echoed by counting pine in tips and tricks, wherein he wants posters in that thread to not just post code but explain it. In this case I believe (not %100 sure) mrminecraft is ESL (English as a second language) and t...
by sancho3
Nov 13, 2018 6:27
Forum: Tips and Tricks
Topic: Multikey key release
Replies: 12
Views: 266

Re: Multikey key release

@Dodicat: I didn't see your state variable before. It looks interesting and the demo works great. I dd a state variable as well. Mine was rudimentary compared to this. Just a variable field (integer) and a boolean set to true when the variable was first set to a value. I had the notion that I would ...
by sancho3
Nov 12, 2018 7:23
Forum: Documentation
Topic: Union
Replies: 24
Views: 752

Re: Union

Feel free to apologize to fxm anytime you want.
by sancho3
Nov 12, 2018 6:09
Forum: Documentation
Topic: Union
Replies: 24
Views: 752

Re: Union

@Munair:
I'll take unnecessary posts for 100 Alex...
This thread is done and in the future please read the whole thread before posting.

Go to advanced search