Search found 48 matches

by fzabkar
Aug 30, 2020 4:28
Forum: Beginners
Topic: Strange command line parsing behaviour
Replies: 20
Views: 928

Re: Strange command line parsing behaviour

jj2007 wrote:If you insist on passing such odd arguments, use GetCommandLine and parse it manually. That works.

The compiler throws an error when I include "windows.bi":

https://www.freebasic.net/forum/viewtopic.php?f=3&p=275445#p275445
by fzabkar
Aug 30, 2020 4:23
Forum: General
Topic: Commandline parsing problem
Replies: 25
Views: 2336

Re: Commandline parsing problem

I'm seeing the same problem in FB ver 1.07.1. I have posted some examples in this thread: https://www.freebasic.net/forum/viewtopic.php?f=2&t=28783&p=275441#p275441 It appears to be a bug in FB, but nobody has reported it. BTW, when I include "windows.bi", the compiler throws an er...
by fzabkar
Aug 30, 2020 0:36
Forum: Beginners
Topic: Strange command line parsing behaviour
Replies: 20
Views: 928

Re: Strange command line parsing behaviour

Dragging the two files in Explorer does print both file names. I can't see how this helps me, though. The \" sequence is indeed being interpreted as an escape sequence, but all of the other escape sequences are interpreted literally, ie the backslash is printed in those other cases. I would lik...
by fzabkar
Aug 29, 2020 22:10
Forum: Beginners
Topic: Strange command line parsing behaviour
Replies: 20
Views: 928

Strange command line parsing behaviour

When I try to parse a command line containing \", I get weird results. It appears that \" resolves to an apostrophe, and the following text is then messed up. All of the other escape sequences seem to be interpreted literally. https://documentation.help/FreeBASIC/TblEscapeSequences.html My...
by fzabkar
Jul 31, 2020 19:06
Forum: General
Topic: Suspicious pointer assignment
Replies: 14
Views: 619

Re: Suspicious pointer assignment

Perhaps I'm demonstrating my ignorance, but is it possible for "filptr = Callocate( buffsize )" to return an address which doesn't fall on a word or dword boundary? If so, then what would be the result of "wdfilptr = filptr" or "dwfilptr = filptr"? Does a ULong pointer ...
by fzabkar
Jul 31, 2020 1:47
Forum: General
Topic: Suspicious pointer assignment
Replies: 14
Views: 619

Re: Suspicious pointer assignment

Thanks again. I wish I had asked this question years ago. I can't tell you in how many programs I've repeated this "madness". The warning is deceptively benign. It sounds like the compiler is saying "hey, here's something I don't understand, but as long as you're happy with it, I'm OK...
by fzabkar
Jul 31, 2020 0:31
Forum: General
Topic: Suspicious pointer assignment
Replies: 14
Views: 619

Suspicious pointer assignment

I have a program which computes a checksum over a file using various algorithms. One algorithm adds all the bytes, a second adds all the 16-bit words, and a third adds the 32-bit dwords. I define three pointers to the data buffer, and the program performs correctly, but the compiler generates warnin...
by fzabkar
Jul 30, 2020 23:53
Forum: General
Topic: Compiler warning for mixed Boolean and numeric
Replies: 2
Views: 153

Re: Compiler warning for mixed Boolean and numeric

Thanks. I did examine the docs for CBool, but they were inconclusive. There are no examples that match my requirements, and the docs talk about expressions rather than "comparisons". But I'm not a programmer ... https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgCbool BTW, thanks for aler...
by fzabkar
Jul 30, 2020 23:37
Forum: General
Topic: Kill and Recycle Bin
Replies: 2
Views: 148

Re: Kill and Recycle Bin

Thanks for the confirmation.
by fzabkar
Jul 30, 2020 23:35
Forum: General
Topic: Compiler warning for mixed Boolean and numeric
Replies: 2
Views: 153

Compiler warning for mixed Boolean and numeric

The following statement generates a compiler warning in regard to mixing Boolean and numeric values:

    If ( boolvar1 And ( intvar1 = intvar2) And ( Not boolvar2 ) ) Then

Is it safe to ignore the warning, and will the statement always be evaluated as expected?
by fzabkar
Jul 30, 2020 23:31
Forum: General
Topic: Kill and Recycle Bin
Replies: 2
Views: 148

Kill and Recycle Bin

Can the Kill( filename ) function of FreeBasic be configured to reflect the settings for the Windows Recycle Bin, or are files always deleted regardless of the settings?
by fzabkar
Oct 19, 2019 21:39
Forum: Beginners
Topic: Arithmetic overflow handling
Replies: 4
Views: 702

Re: Arithmetic overflow handling

Thanks for all the replies. I have discovered that VB6 code defaults to checking for integer overflows and generates an OverflowException when one occurs. This behaviour can be disabled in the compiler options. I have programmed in QBasic and FreeBASIC, and now I'm trying to get my head around VB6 (...
by fzabkar
Oct 08, 2019 20:52
Forum: Beginners
Topic: Arithmetic overflow handling
Replies: 4
Views: 702

Arithmetic overflow handling

If I add two large 16-bit numbers in FreeBASIC, and if the result is a 17-bit number, then the 17th bit goes into the bit bucket without generating an error message. This is the behaviour that I prefer when I am computing a checksum over a word array. I am currently maintaining source code written i...
by fzabkar
Jul 12, 2019 8:41
Forum: General
Topic: NUL device in DOS and Windows
Replies: 6
Views: 2271

Re: NUL device in DOS and Windows

This code works in DOS and Win32: #include "vbcompat.bi" #include "dir.bi" Dim i As Integer Dim blockdir As String ' Find the next available subdirectory for module components and create it For i = 0 To &HFF blockdir = "Blocks_" & Hex( i, 2 ) If Dir( blockdir, f...
by fzabkar
Jul 12, 2019 4:05
Forum: General
Topic: NUL device in DOS and Windows
Replies: 6
Views: 2271

Re: NUL device in DOS and Windows

In the following example there is only one existing directory (Blocks_00). DOS correctly finds the next available directory (Blocks_01), but Win32 doesn't. #include "vbcompat.bi" Dim i As Integer Dim blockdir As String ' Find the next available subdirectory and create it Print "Testin...

Go to advanced search