Search found 849 matches

by grindstone
Nov 18, 2021 9:28
Forum: Beginners
Topic: External DATA file
Replies: 3
Views: 980

Re: External DATA file

Alternatively you could access the file via OPEN and INPUT at runtime, but then you'd have to do the parsing by yourself.
by grindstone
Oct 18, 2021 14:44
Forum: Community Discussion
Topic: Observations.
Replies: 138
Views: 15555

Re: Observations.

I consider it a bit overdone to turf MrSwiss out of the forum. From his behaviour I assume that he's an autist and not really able to understand why his fellow human beings feel offended by his well-intended hints. Just my personal opinion.
by grindstone
Sep 25, 2021 11:38
Forum: General
Topic: 2d data structure without fixed boundaries
Replies: 23
Views: 3685

Re: 2d data structure without fixed boundaries

IMHO the (mis-)use of an image is still the simpler solution. When using a tiles array instead of pointers (a silly idea, I confess), if there are not more than 255 different tiles, the colour depth can be reduced to 8 bits. That means a memory usage of 11kB for a 100 x 100 fields board. Furthermore...
by grindstone
Sep 23, 2021 10:54
Forum: General
Topic: 2d data structure without fixed boundaries
Replies: 23
Views: 3685

Re: 2d data structure without fixed boundaries

Edit: I was wrong, the map is not limited, but there is a bug. Fixed. Another ideas that just popped up, is to work with a 'list of rows'. That would mean a dynamic array of dynamic arrays (of different sizes). It's possible, but quite complicated. And I have no clue if the resizing works flawless....
by grindstone
Sep 22, 2021 12:46
Forum: General
Topic: 2d data structure without fixed boundaries
Replies: 23
Views: 3685

Re: 2d data structure without fixed boundaries

The other big problem is trying to understand 2000 lines of code and then figure out what I can use. Understandable. *grin* After rethinking the problem I would suggest another approach. FB already has a built-in 2D map with all necessary tools which work mighty fine: The image and graphics stateme...
by grindstone
Sep 21, 2021 13:29
Forum: General
Topic: 2d data structure without fixed boundaries
Replies: 23
Views: 3685

Re: 2d data structure without fixed boundaries

Flowchart part 2: Function parse(flag As Integer) As String If flag = 0 Then Return parse(, Chr(0)) 'rest des strings zurückgeben EndIf End Function Function parse(satz As String = "", trenner As String = "") As String Static As String s, t, r Static As Integer a, e If trenner = ...
by grindstone
Sep 21, 2021 13:28
Forum: General
Topic: 2d data structure without fixed boundaries
Replies: 23
Views: 3685

Re: 2d data structure without fixed boundaries

After firstly reading the rules of "Carcassonne" (a very interesting game, IMHO) I think I understand now what you have in mind. It reminds me of a flowchart editor I wrote some years ago, and some of its features are exactly what you're looking for. It's completely in german, sorry for th...
by grindstone
Sep 19, 2021 13:45
Forum: Linux
Topic: Video & Audio data base & Player
Replies: 13
Views: 4430

Re: Video & Audio data base & Player

From my experience, libVLC is the jack-of-all-trades-device for media purposes. Some time ago I wrote this little snippet for Windows, but it should work at Linux, too. Maybe you can find something useful in it: 'Example of a VERY basic media player using libVLC #Inclib "vlccore" #Include ...
by grindstone
Aug 11, 2021 8:45
Forum: Sources, Examples, Tips and Tricks
Topic: getjoystick() demo
Replies: 12
Views: 2812

Re: getjoystick() demo

Very interesting. With this modified example code you can find out if any of the buttons is recognized at all: ' sdl2 gamepad lib based on FreeBASIC-1.07.2-gcc-5.2 #Include "SDL2/SDL.bi" If (Not SDL_Init(SDL_INIT_EVERYTHING) = 0) Then Print "SDL_init(SDL_INIT_JOYSTICK) error! " &...
by grindstone
Aug 08, 2021 15:24
Forum: Sources, Examples, Tips and Tricks
Topic: getjoystick() demo
Replies: 12
Views: 2812

Re: getjoystick() demo

thrive4 wrote:...so it's hard to tell if adding the guide button (xinput) is feasible...
It's quite easy to find out. Run the example code from the documentation, maybe replace

Code: Select all

For a = 0 To 26
with

Code: Select all

For a = 0 To 32
then press the guide button and look if something happens.
by grindstone
Aug 07, 2021 14:44
Forum: Beginners
Topic: Can not compile project 'FB Plot Lib ' (
Replies: 11
Views: 1616

Re: Can not compile project 'FB Plot Lib ' (

This project seems to have a lot of dependencies. The more I download the more errors I get, including "Duplicated definition". To me it seems to be quite chaotic.
by grindstone
Jul 31, 2021 19:04
Forum: General
Topic: How to translate this piece of code to FB?
Replies: 6
Views: 1001

Re: How to translate this piece of code to FB?

Alright, is it this what you wanted? shape.bi #Pragma Once Type Shape As Integer x As Integer y End Type Declare Sub Shape_ctor(me As Shape Const Ptr, ByVal x As Integer, ByVal y As Integer) Declare Sub Shape_moveby(me As Shape Const Ptr, ByVal dx As Integer, ByVal dy As Integer) Declare Function Sh...
by grindstone
Jul 31, 2021 18:38
Forum: General
Topic: How to translate this piece of code to FB?
Replies: 6
Views: 1001

Re: How to translate this piece of code to FB?

What is the point of this, my friend? Shape_ctor is used to emulate a constructor, you set it to print the value of the attributes into the screen so it's useless! My intention was to show how the Const keyword works in FB. And because your shape.bi isn't available here, I wrote that litte example ...
by grindstone
Jul 31, 2021 17:26
Forum: General
Topic: How to translate this piece of code to FB?
Replies: 6
Views: 1001

Re: How to translate this piece of code to FB?

To protect the pointer the Const has to be put before the Ptr : Type shape x As Short '/* x-coordinate of Shape's position */ y As Short ' /* y-coordinate of Shape's position */ End Type Declare Sub Shape_ctor(ByVal me As Shape Const Ptr, ByVal x As Short, ByVal y As Short) Dim As Shape s1, s2 Shape...
by grindstone
Jul 26, 2021 10:55
Forum: General
Topic: Read and write clipboard (Linux and Windows)
Replies: 30
Views: 3492

Re: Read and write clipboard (Linux and Windows)

...but it's not doing anything on the clipboard when I try it on a windows machine... Here (with WinXP and GIMP) it works. Once having run dodicat's snippet I can copy the picture (or is it a graphic?) to a GIMP sheet by pressing "Ctrl + v". For reading/writing text I usually use these tw...