Search found 255 matches

by codeFoil
Sep 22, 2022 1:41
Forum: DOS
Topic: Let's develop OpenWinDOS
Replies: 54
Views: 12045

Re: Let's develop OpenWinDOS

The callback implementation that you have been shown is using pointers to function/subs. Pointers are memory addresses, and memory addresses are essentially integer types. So, when coerced to a boolean value, the only time they will evaluate to false is when the memory address is 0. dim as Window w ...
by codeFoil
Sep 11, 2016 18:52
Forum: General
Topic: Why typed const not allowed to put in a binary file ?
Replies: 7
Views: 1514

Re: Why typed const not allowed to put in a binary file ?

I apologize in advance. I'm going to use the term "constant variable" below. I know that's an oxymoron. For this sample: STATIC SHARED AS integer aVar = &hCF STATIC SHARED AS CONST integer aConstVar = &hCE CONST AS integer aConst = &hCD Print &hCC Print aConst Print aConstV...
by codeFoil
Sep 11, 2016 9:32
Forum: General
Topic: Why typed const not allowed to put in a binary file ?
Replies: 7
Views: 1514

Re: Why typed const not allowed to put in a binary file ?

I think you've answered your own question. I suspect that the call to fb_FilePut requires a memory address. Integral constants are emitted literally to the backend, so they are neither in static storage, the stack, or the heap. There is another work around however. You can use a variable with the &q...
by codeFoil
Jul 26, 2014 17:17
Forum: General
Topic: Suggest file compare tool
Replies: 6
Views: 1399

Re: Suggest file compare tool

By the way, the command line tool FC is still included in Windows (at least up to Win 7).
by codeFoil
Jul 26, 2014 7:29
Forum: Beginners
Topic: Putting null string to file using crt routines puts or fputs
Replies: 7
Views: 1591

Re: Putting null string to file using crt routines puts or f

Here is an alternative that relies only on the return of StrPtr

Code: Select all

SUB TryPuts(BYREF s as const STRING)

    VAR sPtr = StrPtr(s)
    IF sPtr ANDALSO puts(sPtr)  THEN
        Print "puts failed."
    END IF

END SUB
by codeFoil
Jul 26, 2014 7:07
Forum: Beginners
Topic: Putting null string to file using crt routines puts or fputs
Replies: 7
Views: 1591

Re: Putting null string to file using crt routines puts or f

Welcome to the forum. I am not quite sure what your question is, but I can try to explain the results you have mentioned. Since an empty string has no contents, no memory is allocated for it, so any time you need to pass the address of a STRING that might be empty, you need to check for that special...
by codeFoil
Jul 26, 2014 6:22
Forum: Sources, Examples, Tips and Tricks
Topic: Warp Speed screen scaling!
Replies: 7
Views: 3068

Re: Warp Speed screen scaling!

anonymous1337 wrote:I'd upvote this purely for the cleanliness of the ASM.
I second that.

I've heard tell of a time when tabbing assembly language was required, but that was long before x86.
I usually try to tab assembly into four fields. Label, mnemonic, operands, comment.
by codeFoil
Jul 19, 2014 0:10
Forum: Beginners
Topic: Can someone tell me why this doesn't work? (SOLVED)
Replies: 12
Views: 2357

Re: Can someone tell me why this doesn't work? (SOLVED)

Rev5 wrote:Now I know about Len() too.
I should point out that is would have been wise of me to use SizeOf() rather than Len().
SizeOf will return the memory size of the data type of an expression.
Len will return the same, unless the data type is a String, in which case it returns a character count.
by codeFoil
Jul 17, 2014 4:17
Forum: Beginners
Topic: Can someone tell me why this doesn't work? (SOLVED)
Replies: 12
Views: 2357

Re: Can someone tell me why this doesn't work?

Try adding this somewhere in your source. Print Len(TRUE) You'll find that the expression you've defined (NOT TRUE) is being evaluated as a 4 byte Integer. When you cast -1 to a UBYTE, you do indeed have all 8 bits set, which equals 255, but you are comparing it to a 32 bit signed value with all bit...
by codeFoil
Jul 04, 2014 3:38
Forum: Community Discussion
Topic: How many people actually use FreeBasic?
Replies: 85
Views: 22335

Re: How many people actually use FreeBasic?

Pretty old thread, but I thought I'd chime in. I use FreeBASIC daily just for the pleasure of it. I'm capable in x86 assembly and C, have a familiarity with C++, Java, Python, and Javascript, and I know enough about the .NET family to know I don't need them. Over the years I have absorbed a lot of t...
by codeFoil
Sep 27, 2012 23:37
Forum: Beginners
Topic: Palindrome is possible ?????
Replies: 5
Views: 1591

Re: Palindrome is possible ?????

Color me surprised.... and a little underwhelmed :)
by codeFoil
Sep 27, 2012 23:33
Forum: Community Discussion
Topic: FreeBASIC on iOS
Replies: 13
Views: 13103

Re: FreeBASIC on iOS

The only problem then would be to develop a version of the compiler to run under the Android operating system.
= dalvik Java machine byte code... so the task remains the same.
by codeFoil
Sep 26, 2012 23:56
Forum: Beginners
Topic: Palindrome is possible ?????
Replies: 5
Views: 1591

Re: Palindrome is possible ?????

Perhaps it might be possible in lang qb or fblite, but in lang fb (without a trick header file included on the command line) I would be surpised.
by codeFoil
Sep 22, 2012 0:22
Forum: Documentation
Topic: exponentiate, exponentiate and assign
Replies: 6
Views: 2152

Re: exponentiate, exponentiate and assign

Logical operators and operators for exponents and remainders are the most common differences between programming language families. When you're porting from one to another, it's a good idea to just keep the list of operators and their precedence handy. Check the wiki for the operator precedence page...
by codeFoil
Sep 11, 2012 0:02
Forum: General
Topic: How to get os name,platform,version,kernel version and build
Replies: 13
Views: 2562

Re: How to get os name,platform,version,kernel version and b

if I understand your question, you want a solution without using any system dependent API That was my first impression, but I think now that he meant without using conditional compilation. I'm not sure if this was presented as a request for help or as a programming challenge. Perhaps XXXX3r ADI sho...