Search found 1945 matches

by angros47
Jul 02, 2022 22:51
Forum: DOS
Topic: DOS drivers in FreeBASIC
Replies: 8
Views: 267

Re: DOS drivers in FreeBASIC

Yes, exactly. You will just have to avoid loading both libraries at the same time, of course. Likely your program can read a configuration file, and load the appropriate library.
by angros47
Jul 02, 2022 22:42
Forum: General
Topic: Weird behavior in fixed length strings
Replies: 0
Views: 37

Weird behavior in fixed length strings

While a ZSTRING can't contain a null byte, a regular string should be able to contain it, no matter if it is a variable length or a fixed length one. Yet, I found a strange behavior: dim s as string*80=chr(0)+"Alpha"+chr(0)+"Beta" print asc(s) print s as expected, the first chara...
by angros47
Jul 02, 2022 19:31
Forum: General
Topic: TUI font
Replies: 5
Views: 85

Re: TUI font

Right, I forgot, because it compiles perfectly under Linux, since cdecl is the standard here.

So, if we want to split the hair, your comment should have been "'' Otherwise it doesn't compile on Windows"
by angros47
Jul 02, 2022 18:51
Forum: General
Topic: TUI font
Replies: 5
Views: 85

TUI font

Years ago I tried to make a font for a TUI in QBASIC. http://www.petesqbsite.com/phpBB3/viewtopic.php?f=3&t=3165&p=20107&sid=8934c3af2075ece11f4dba689127437c#p20107 I tried porting it to FreeBasic: type Font w as long h as long d as any ptr end type enum FB_FONT_8 = 0, FB_FONT_14 FB_FONT...
by angros47
Jun 30, 2022 23:48
Forum: General
Topic: Feature request: strings in UDTs
Replies: 28
Views: 956

Re: Feature request: strings in UDTs

In the old QBASIC there was also another reason for not using the 0 terminator: since QBASIC didn't have the BYTE data type , the only way to store a single byte variable inside an UDT was to store it as STRING*1. Adding a zero after that would have made it useless. FreeBasic has the BYTE and UBYTE ...
by angros47
Jun 30, 2022 6:57
Forum: DOS
Topic: OpenGL for DOS?
Replies: 1
Views: 84

Re: OpenGL for DOS?

There is no plan to support OpenGL in dos, since it would require to include a whole OpenGL driver in the graphic runtime. And the only driver available for dos is a very, very outdated version of Mesa
by angros47
Jun 29, 2022 22:21
Forum: General
Topic: Feature request: strings in UDTs
Replies: 28
Views: 956

Re: Feature request: strings in UDTs

The string must always be null terminated. Otherwise, it won't work with all string functions, because string functions expect a null character. Not necessarily. The only information needed by the string function is where the string ends: and that information can be provided by putting a zero at th...
by angros47
Jun 27, 2022 19:01
Forum: Community Discussion
Topic: Suggestion about the inner Dictionary or Collection.
Replies: 9
Views: 399

Re: Suggestion about the inner Dictionary or Collection.

Well, using generics you wouldn't have to dig deeply in the language, all you have to do is to include a simple header file. In C++ (that uses generics), if you want to implement a linked list, or an associative array, you can dig in the language, but you don't have to if you don't want. Declaring a...
by angros47
Jun 27, 2022 10:42
Forum: Windows
Topic: Drawing directly on the screen
Replies: 0
Views: 106

Drawing directly on the screen

This example should draw a line on the screen, over the windows already displayed

Code: Select all

#include "Windows.bi"

dim as HDC hDC = GetDC(0)

MoveToEx(hdc, 0, 0, NULL)
LineTo(hdc, 1000, 1000)
ReleaseDC(NULL, hdc)

by angros47
Jun 27, 2022 0:35
Forum: Community Discussion
Topic: Suggestion about the inner Dictionary or Collection.
Replies: 9
Views: 399

Re: Suggestion about the inner Dictionary or Collection.

Actually, there are two possibilities: one is implementing generics, the other is implementing only some containers (dictionaries and lists, for example) as part of the language. Both solutions have advantages and disadvantages: generics and templates is surely more versatile, although more like c++...
by angros47
Jun 26, 2022 10:35
Forum: Community Discussion
Topic: Suggestion about the inner Dictionary or Collection.
Replies: 9
Views: 399

Re: Suggestion about the inner Dictionary or Collection.

Do you suggest to implement it using hash table or binary tree?
by angros47
Jun 24, 2022 10:44
Forum: General
Topic: Feature request: strings in UDTs
Replies: 28
Views: 956

Re: Feature request: strings in UDTs

By the way, a ZSTRING doesn't have that issue: its length is exactly as declared, inside a type Yes, but the maximum number of useful characters for the user is 'length - 1' (because of the mandatory terminal character). I made some tests: it is actually possible to use all the characters, removing...
by angros47
Jun 23, 2022 17:19
Forum: General
Topic: Feature request: strings in UDTs
Replies: 28
Views: 956

Re: Feature request: strings in UDTs

What is the point of using a FIELD parameter when you can already use ZSTRING? It's literally just one character to add. Maybe in QB mode the strings inside a TYPE should be treated as ZSTRINGS, just to make UDT compatible with QB (in case one is porting a program that was supposed to read a file wi...
by angros47
Jun 23, 2022 16:26
Forum: General
Topic: Feature request: strings in UDTs
Replies: 28
Views: 956

Re: Feature request: strings in UDTs

At this point, I doubt: changing that would break too much existing FreeBasic code.

By the way, a ZSTRING doesn't have that issue: its length is exactly as declared, inside a type
by angros47
Jun 18, 2022 16:41
Forum: DOS
Topic: Some questions about fbc for DOS/FreeDOS.
Replies: 2
Views: 186

Re: Some questions about fbc for DOS/FreeDOS.

1) No, I have just tested on DosBox, FreeBasic returns an error message if there is no DPMI extender. By the way, is the file CWSDPMI.EXE either in the FreeBasic directory, or in another directory in the search path, the program written in FreeBasic (and the compiler itself) can invoke it, loading a...