Search found 639 matches

by grindstone
Oct 17, 2019 11:28
Forum: General
Topic: Pan and Zoom 2D with mouse (solved)
Replies: 6
Views: 208

Re: Pan and Zoom 2D with mouse

Whatever the origin of your trouble may be, the polling of the mouse wheel surely in't: #Define RES_W 1920 #Define RES_H 1080 Static As Integer old_ms Dim As Integer mx,my,ms,mb Dim As Double zoom, pan_x, pan_y Do GetMouse mx,my,ms,mb If ms <> old_ms Then Zoom = (ms+4) / 4 '' Zoom in increments of ....
by grindstone
Oct 16, 2019 14:41
Forum: Community Discussion
Topic: [offtopic] retro computing VASM
Replies: 9
Views: 457

Re: [offtopic] retro computing VASM

But an FB - AVR - compiler would be great anyway. :-D
by grindstone
Oct 15, 2019 13:27
Forum: Community Discussion
Topic: [offtopic] retro computing VASM
Replies: 9
Views: 457

Re: [offtopic] retro computing VASM

A freeBasic compiler for AVR would be GREAT!!!
by grindstone
Oct 05, 2019 15:11
Forum: General
Topic: String Sort problem
Replies: 24
Views: 560

Re: String Sort problem

Dinosaur wrote:Each time I replace a Comma, I remembered the position with LFCnt.LF(X):

Could it be that you DIMmed an array inside your UDT and try to access it beyond its upper bound?
by grindstone
Oct 03, 2019 16:54
Forum: General
Topic: Sound file sample access (WAV or MP3)
Replies: 6
Views: 287

Re: Sound file sample access (WAV or MP3)

I don't know what exactly you want to do, but here's a snippet that normalizes a single wav - file (pcm or float). It's part of a program I use to batch - normalize / convert the wav - files of a whole directory. For the conversion it uses ffmpeg . #Include "..\fbm_RIFFheader.bas" #Include...
by grindstone
Sep 20, 2019 9:38
Forum: Beginners
Topic: File created by an external program
Replies: 4
Views: 343

Re: File created by an external program

In Windows, you could try to open the file in exclusive mode. This will fail as long as the file is accessed by an other program: #Include "windows.bi" Dim As HANDLE fh Dim As String filename = "c:\testfile.txt" Do fh = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0...
by grindstone
Aug 31, 2019 15:04
Forum: Windows
Topic: open output file with no name
Replies: 2
Views: 2519

Re: open output file with no name

If you slightly change this snippet to

Code: Select all

Dim as string filename1
Print Open (filename1 for output as #1)
Sleep
you'll see that it retrurns error code 2, meaning "File not found". So no file will be created.
by grindstone
Aug 24, 2019 13:49
Forum: General
Topic: Does FreeBASIC Have a Published Project Roadmap?
Replies: 3
Views: 2876

Re: Does FreeBASIC Have a Published Project Roadmap?

Does FreeBASIC have a published project roadmap? Alas, here in this forum those treasures are spread all over the place. But if you don't mind the german language, you will find a well-organized collection of code examples and projects on the german FB-site (partly with descripions in english). May...
by grindstone
Aug 24, 2019 12:27
Forum: Projects
Topic: Porting BASIC Code from Classic 8-Bitters to FreeBASIC?
Replies: 4
Views: 3286

Re: Porting BASIC Code from Classic 8-Bitters to FreeBASIC?

What's the best way to handle 8×8 bitmap tiles? Obviously, it's not going to be "overwrite the system font." With IMAGECREATE you can create tiles of any desired size. Is there anything like sprite functionality in FreeBASIC? No. You have to deal with this stuff yourself. But there are so...
by grindstone
Apr 17, 2019 12:39
Forum: General
Topic: Check if active
Replies: 4
Views: 455

Re: Check if active

Something like this? #Include "windows.bi" #Include "win\psapi.bi" Dim As HANDLE processhandle, hwnd Dim As ULong PID Dim As ZString*MAX_PATH filename hwnd = GetActiveWindow() If hwnd Then GetWindowThreadProcessId(hwnd, @PID) processHandle = OpenProcess(PROCESS_QUERY_INFORMATION ...
by grindstone
Mar 07, 2019 20:24
Forum: General
Topic: Loading Files
Replies: 6
Views: 623

Re: Loading Files

I would prefer the upper one, because FB does the memory management for me, and I can (mis-)use FB's string functions on the content.
by grindstone
Mar 07, 2019 9:41
Forum: General
Topic: Loading Files
Replies: 6
Views: 623

Re: Loading Files

Why that complicated?

Code: Select all

Open "MySoundFile.mp3" For Binary Access Read As #1
Dim As String g = Input(Lof(1), #1)
Close 1
by grindstone
Feb 08, 2019 10:56
Forum: Beginners
Topic: Matrix to string
Replies: 15
Views: 962

Re: Matrix to string

The sub is that awfully slow, because with every extension the whole existing string is copied to an other memory location. Better once create an empty string of spaces of the necessary length an then replace the spaces with the converted doubles (maybe even faster with indexed strings instead of MI...
by grindstone
Feb 08, 2019 9:13
Forum: Tips and Tricks
Topic: Image Painting Demos [Windows only]
Replies: 22
Views: 1817

Re: Image Painting Demos [Windows only]

@MrSwiss: You can't help doing it...

@UEZ: Just consider it as a nonbinding expression of opinion and follow your way.

Go to advanced search