Search found 6104 matches

by dodicat
Feb 11, 2020 11:52
Forum: Community Discussion
Topic: substrings
Replies: 39
Views: 1605

Re: substrings

In your first post .. a$(c:d) rather than mid$(a$,c+1,d-c+1) .. So you can just make a macro to save writing it out, and mid is very fast, and mid can be a function or a statement, thus it is versatile. #define md(s,c,d) mid(s,c+1,d-c+1) dim as string alphabet="abcdefghijklmnopqrstuvwxyz" ...
by dodicat
Feb 10, 2020 21:40
Forum: Game Dev
Topic: Moving on random spline loops with near const speed !
Replies: 8
Views: 386

Re: Moving on random spline loops with near const speed !

Nice. The two Catmull Rom end points are a nuisance when closing a loop.(I find anyway) Here is my effort, West to East but draggable, not Catmull Rom, but a particle trajectory. Screen 20,32 Dim Shared As Integer xres,yres Screeninfo xres,yres Type Point As Single x,y,z End Type Type particle As Po...
by dodicat
Feb 10, 2020 0:35
Forum: Windows
Topic: Function name decoration issue
Replies: 13
Views: 450

Re: Function name decoration issue

Passing a string byval is slower than using a static copy inside a function, and passing byref. sub dothis(byval s as string) s+=" zzz" end sub sub dothis2(byref s as string) static as string g:g=s g+=" zzz" end sub dim as long lim=1000000 dim as double t dim as string x="HE...
by dodicat
Feb 09, 2020 23:51
Forum: General
Topic: Squares
Replies: 7620
Views: 456291

Re: Squares

I was having a cuppa today in a local garden centre when I noticed one of our Scottish Labour Party MSP'S doing likewise. We don't often see Parliamentarians here, we are a bit remote. I didn't trouble the fellow of course, but I emailed his office tonight regarding the threatened woodland. Maybe he...
by dodicat
Feb 09, 2020 18:11
Forum: Community Discussion
Topic: substrings
Replies: 39
Views: 1605

Re: substrings

Hi jj2007 I get an empty string return. Dim shared as zstring ptr retStr retStr = CAllocate(8000) ' pointer to destination Function SubStringJ naked stdcall ( s As String,StrStart As Uinteger,StrEnd As Uinteger ) As String Asm ' SubStringJ(MyStr,10,ln) push esi push edi mov esi, [esp+12] ' String ad...
by dodicat
Feb 09, 2020 13:21
Forum: General
Topic: Brexit day.
Replies: 7
Views: 379

Re: Brexit day.

A new definition of horizontal.
by dodicat
Feb 09, 2020 13:19
Forum: Community Discussion
Topic: substrings
Replies: 39
Views: 1605

Re: substrings

If this is a race then I''ll pull out all the stops. 'function substring2 by dodicat 'https://www.freebasic.net/forum/viewtopic.php?p=268485#p268485 #include "crt.bi" function substring2(_in as string, x as long,y as long) byref as const zstring static as zstring * 5000 g="" memc...
by dodicat
Feb 08, 2020 23:16
Forum: Community Discussion
Topic: SSD's life expectancy
Replies: 26
Views: 804

Re: SSD's life expectancy

Thanks Deltarho[]
I have fixed a small bug in mine.
But yes, kinda the same, I use pipe into a string instead of a file, and split this string up.
Yours is neater.
by dodicat
Feb 08, 2020 21:50
Forum: Community Discussion
Topic: SSD's life expectancy
Replies: 26
Views: 804

Re: SSD's life expectancy

hi Deltarho[] messing around win 10 Function pipeout(Byval s As String="") Byref As String Var f=Freefile Dim As String tmp Open Pipe s For Input As #f s="" Do Until Eof(f) Line Input #f,tmp s+=tmp+Chr(10) Loop Close #f Return s End Function Function StringSplit(s_in As String,ch...
by dodicat
Feb 08, 2020 18:35
Forum: Documentation
Topic: Wiki improvements
Replies: 395
Views: 65419

Re: Wiki improvements

Here is the .def file for strings.dll (above post) . . . ; ; Definition file of strings.dll ; Automatic generated by gendef ; written by Kai Tietz 2008 ; LIBRARY "strings.dll" EXPORTS _ZN7STRINGSC1ER8FBSTRINGaii _ZN7STRINGSC1Ev . . . So it looks like you can convert constructors to functio...
by dodicat
Feb 08, 2020 13:10
Forum: Documentation
Topic: Wiki improvements
Replies: 395
Views: 65419

Re: Wiki improvements

For fun. strings.bas compile -dll 'strings.bas compile with -dll switch Enum up down End Enum type strings as string original as string sorted as byte direction declare constructor declare constructor(as string, as byte,as long,as long) declare function sort(as strings,as long,as long) as string end...
by dodicat
Feb 05, 2020 23:54
Forum: Beginners
Topic: _ldisphelper
Replies: 3
Views: 135

Re: _ldisphelper

Here is a 32 bit .a disphelper lib file. https://www.freebasic.net/forum/viewtopic.php?f=2&t=27820&p=263770&hilit=disphelper#p263770 To test it put it in the same folder as your running code. If you like it you can put it in your fb installation lib folder. Here is a small tester code. #...
by dodicat
Feb 05, 2020 23:12
Forum: Community Discussion
Topic: substrings
Replies: 39
Views: 1605

Re: substrings

srvaldez
Er . . . hmm, how right you are, I didn't call my own function at all.
I think it is time (2308) to take the dogs for a walk.
It is worrying of course at 71 years old, not to call your own function.
Thank you.
by dodicat
Feb 05, 2020 22:49
Forum: General
Topic: Squares
Replies: 7620
Views: 456291

Re: Squares

My sister had one of these UFO encounters many years ago. Who am I to argue with her, I wasn't there. We see everything through a slow moving electromagnetic radiation, we call it electromagnetic because of experiments we have devised to study it. We worked out it's speed in a field (actual grassy t...
by dodicat
Feb 05, 2020 19:34
Forum: Community Discussion
Topic: substrings
Replies: 39
Views: 1605

Re: substrings

Hi srvaldez.
The pointer is a bit faster here.
Maybe
static as zstring * 5000 g=""
Would be better (same speed)

But MID is just as fast as either of the methods.

Go to advanced search