Search found 7927 matches

by dodicat
Mar 29, 2024 20:16
Forum: Beginners
Topic: array initialization
Replies: 7
Views: 213

Re: array initialization

A little macro to fill an array without too much typing: #macro fill(a,r,datatype,d...) Redim a(r) Scope Dim As datatype x(r)=d For n As Long=0 To Ubound(a) a(n)=x(n) Next End Scope #endmacro Dim Shared As String f() fill(f,2,String,{"apple", "orange", "banana"}) Dim Sh...
by dodicat
Mar 29, 2024 19:24
Forum: Windows
Topic: Cairo under Windows
Replies: 9
Views: 256

Re: Cairo under Windows

Here is how I do fonts in Cairo, I have found no problems with the method. (Tested 64 bits) Win 11. #cmdline "-s gui" #include "fbgfx.bi" #include once "cairo/cairo.bi" #define _rd_ Cast(Ubyte Ptr,@colour)[2]/255 #define _gr_ Cast(Ubyte Ptr,@colour)[1]/255 #define _bl_ ...
by dodicat
Mar 27, 2024 10:53
Forum: Windows
Topic: Cairo under Windows
Replies: 9
Views: 256

Re: Cairo under Windows

Hi UEZ/Roland. I'm hardly ever on the pascal forum these days, but I have the 3.2.2 compiler here. A strange thing happened here on win 11. I was messing about with UEZ's code , trying to get an opengl screen ensconced in a win32 api using a winproc function. At some stage during my tribulations I h...
by dodicat
Mar 26, 2024 13:13
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 228
Views: 20618

Re: Freebasic 1.20.0 Development

Thanks for the link fxm.
by dodicat
Mar 26, 2024 10:59
Forum: Community Discussion
Topic: Freebasic 1.20.0 Development
Replies: 228
Views: 20618

Re: Freebasic 1.20.0 Development

I tried to force a const chr(0). Results: '#include "crt.bi" const C=!"\0" #print typeof(C) Sub memcopy(dest As Any Ptr,src As Any Ptr,count As Long) Dim As Ubyte Ptr newdst=dest Dim As Ubyte Ptr newsrc=src While count count-=1 *newdst=*newsrc newdst+=1 newsrc+=1 Wend End Sub pri...
by dodicat
Mar 26, 2024 9:23
Forum: Archive
Topic: quitting smoking app
Replies: 3
Views: 2050

Re: quitting smoking app

The best time to stop smoking is April fool's day, 1 April. I stopped 1 April 10 years ago because as you get older stopping is a life requirement. I know others who have stopped on that day. You very rarely see old people still smoking, a few yes, but these are exceptionally tough people. You will ...
by dodicat
Mar 23, 2024 12:08
Forum: Documentation
Topic: SmartPointer_UDTname_ segmentation violation
Replies: 10
Views: 372

Re: SmartPointer_UDTname_ segmentation violation

That is when you use the option -pp to isolate an error. simple example: fillmatrix.bas '#cmdline "-pp" Type Matrix Dim As Double m( Any , Any ) Declare Constructor ( ) Declare Constructor ( Byval x As Uinteger , Byval y As Uinteger ) Declare Operator Cast() As String End Type Constructor ...
by dodicat
Mar 21, 2024 0:46
Forum: General
Topic: screenres with a vertical scroll bar
Replies: 16
Views: 729

Re: screenres with a vertical scroll bar

The opengl screens are kind of bare bones, they can handle some win32 components. I have not tried scrolling though, maybe sometime. Here are a few: buttons, themes, disable fullscreen, tooltips, fonts. #include "windows.bi" #Include once "/win/commctrl.bi" #include "GL/gl.b...
by dodicat
Mar 20, 2024 11:04
Forum: Community Discussion
Topic: Bugs
Replies: 115
Views: 20858

Re: Bugs

Thank you all for looking into this byval.
Yes srvaldez, static in the sub would have been the proper way.
The last thing I would have thought of was passing a value byval to a procedure, I came across it by accident.
by dodicat
Mar 19, 2024 21:00
Forum: Sources, Examples, Tips and Tricks
Topic: Read line x from a text file
Replies: 2
Views: 151

Re: Read line x from a text file

You have added an extra line end (chr(10)) to the last line in the file in 64 bits. The last line looks strange in 32 bits. 'Coded by UEZ build 2024-03-19 beta #cmdline "-exx" #include "file.bi" Type tFile As WString * 4096 Name End Type Function FileReadLine(sFile As tFile, iLin...
by dodicat
Mar 19, 2024 10:18
Forum: Community Discussion
Topic: Bugs
Replies: 115
Views: 20858

Re: Bugs

Can somebody explain this in fb 1.10 sub test(byref s as integer ptr) print __function__,s dim as integer k s=@k end sub dim as integer g=2024 dim as integer ptr p=@g print " Original pointer value "; p test(p) print "Pointer value after sub "; p p=@g print "________________...
by dodicat
Mar 18, 2024 23:15
Forum: General
Topic: screenres with a vertical scroll bar
Replies: 16
Views: 729

Re: screenres with a vertical scroll bar

You will have to make your own scrolling mechanism for fb screens. this old code: #cmdline "-gen gcc -O 2" '============= FONTS SET UP ========================== Function Filter(Byref tim As Ulong Pointer,_ rad As Single,_ destroy As Long=1,_ fade As Long=0) As Ulong Pointer #define map(a,...
by dodicat
Mar 17, 2024 11:53
Forum: Windows
Topic: How to color text created by CreateWindowExa
Replies: 18
Views: 654

Re: How to color text created by CreateWindowExa

This should start off, only mouse directly on the scroller, I'm sure you'll find all the other options with google 'CODE BY UEZ, added some vertical scrolling #include once "windows.bi" #include "crt.bi" Dim As MSG msg ' Message variable (stores massages) Dim Shared As HWND hWndx...
by dodicat
Mar 17, 2024 2:25
Forum: Windows
Topic: How to color text created by CreateWindowExa
Replies: 18
Views: 654

Re: How to color text created by CreateWindowExa

Here is UEZ's code with scrolling (via a trackbar) 'BY UEZ with scroll added #include once "windows.bi" #Include once "/win/commctrl.bi" Dim As MSG msg ' Message variable (stores massages) Dim Shared As HWND hWndx, stc1, stc2 ,bar ' Window variable and object variables Dim As HFO...
by dodicat
Mar 17, 2024 0:41
Forum: Windows
Topic: How to color text created by CreateWindowExa
Replies: 18
Views: 654

Re: How to color text created by CreateWindowExa

But you can scroll your static windows with coloured text in the same way. In the Winproc, if you use one Case WM_VSCROLL Select Case lparam Case bar trackpos= SendMessage(bar, TBM_GETPOS, 1, 0) then use movewindow adding trackpos or a multiple of it to the y value. You'll have to juggle about with ...