Search found 73 matches

by Kwabbernoot
Feb 05, 2019 10:33
Forum: Beginners
Topic: FBeginner Preview
Replies: 130
Views: 47977

Re: FBeginner Preview

Maybe it is already changed, but in 2012 I've found the following errors:
An error in the example of the EQV function (page 63) line 31: myInt1 > 5 should be: myInt > 3. The same error on the next page showing the results of the example.
by Kwabbernoot
Sep 01, 2018 19:24
Forum: Beginners
Topic: Simple example: Subclassing of an edit control
Replies: 17
Views: 2167

Re: Simple example: Subclassing of an edit control

Instead of SetWindowLongPtr you can use the more modern: SetWindowSubclass
by Kwabbernoot
Mar 24, 2018 20:19
Forum: Beginners
Topic: Set EOF
Replies: 26
Views: 1387

Re: Set EOF

Very useful information. I had exactly the same problem, after rewriting a file, there was still a leftover of old data at the end of the file. I have a serie of programs and each program updates its record in a session logfile. The file is just a simple textfile. I read the whole file into a buffer...
by Kwabbernoot
Nov 11, 2016 15:54
Forum: General
Topic: Bug in multiply and assign
Replies: 6
Views: 704

Re: Bug in multiply and assign

No bug? In that case "lhs *= rhs" is not the same as "lhs = lhs * rhs" The documentation says: lhs *= rhs This operator multiplies and assigns a value to a variable. It is functionally equivalent to: lhs = lhs * rhs http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgOpCombineMult...
by Kwabbernoot
Nov 11, 2016 15:24
Forum: General
Topic: Bug in multiply and assign
Replies: 6
Views: 704

Bug in multiply and assign

Code: Select all

   DIM AS INTEGER Value, Digit
   
   Value = 0
   Digit = 3
   Value *= 10 + Digit
   PRINT Value
   Value = 0
   Value = Value * 10 + Digit
   PRINT Value
   SLEEP


Result:
0 <--- wrong
3

Value *=10 + Digit returns a wrong result.
It only happens if the start value of Value is zero.
by Kwabbernoot
Oct 26, 2016 18:35
Forum: General
Topic: FB doesn't like fixed length strings
Replies: 2
Views: 375

FB doesn't like fixed length strings

Again a problem with fixed length strings. It probably has to do (as always) with a terminating null character somewhere in the middle of the string. Although it's strange that the PRINT statement prints the correct value. But after the assignment to another fixed length string the last part of the ...
by Kwabbernoot
Oct 12, 2016 17:40
Forum: Beginners
Topic: Windows GUI
Replies: 145
Views: 16729

Re: Windows GUI

Provoni, There is a tutorial for Windows API. The examples are written in C. But even if you don't know C, the examples are not difficult to understand. http://zetcode.com/gui/winapi/ Also a lot of examples on this forum and examples in the FreeBasic directory: C:\Program Files (x86)\FreeBASIC\examp...
by Kwabbernoot
Oct 03, 2016 19:51
Forum: Libraries
Topic: FBTrueType static Win/Lin 32/64-bit
Replies: 65
Views: 32307

Re: FBTrueType Windows and Linux (32/64-bit)

This looks great. I can use any font I like by taking a font in: C:\Windows\Fonts.
The letters look beautiful.
This is very much better than the Xfont routines.
viewtopic.php?f=8&t=12078
Good job.
by Kwabbernoot
Oct 31, 2015 16:28
Forum: Beginners
Topic: text color for SetWindowText
Replies: 1
Views: 839

Re: text color for SetWindowText

Via WM_CTLCOLORSTATIC MSDN #DEFINE Win_Backgr &HD0D0D0 #DEFINE Win_Text 0 #DEFINE Win_Red &H0000FF '*** Red DIM AS HDC HwinDC CASE WM_CTLCOLORSTATIC HwinDC = CAST(HDC, wParam) IF CAST(HWND, lParam) = warn1 THEN SetTextColor(HwinDC, Win_Red) ELSE SetTextColor(HwinDC, Win_Text) END IF SetBkCol...
by Kwabbernoot
May 14, 2015 17:54
Forum: Windows
Topic: What happened to the GradientFill function?
Replies: 2
Views: 931

What happened to the GradientFill function?

What happened to the GradientFill function? I've seen that there are now declarations for SetWindowSubclass, DefSubclassProc and so on. So I removed those declarations from my program. But GradientFill still does not work. The compiler complains: Duplicated definition. If I remove the declaration fo...
by Kwabbernoot
Mar 30, 2015 14:10
Forum: Beginners
Topic: FB Equivalent of Records
Replies: 17
Views: 1509

Re: FB Equivalent of Records

My solution is using UBYTE arrays and the use of BytesToString and StringtoBytes procedures. #INCLUDE ONCE "crt/string.bi" '*** for Memcpy DECLARE FUNCTION BytesToString (ByteArray() AS UBYTE) AS STRING DECLARE SUB StringToBytes (InputStr AS STRING, ByteArray() AS UBYTE) Type StockItem FIE...
by Kwabbernoot
Mar 30, 2015 10:36
Forum: Beginners
Topic: FB Equivalent of Records
Replies: 17
Views: 1509

Re: FB Equivalent of Records

I've already seen that the record is 2 bytes too long.
This will be a problem if you want to rewrite the record to an existing file.

Go to advanced search