Search found 254 matches

by codeFoil
Sep 11, 2016 18:52
Forum: General
Topic: Why typed const not allowed to put in a binary file ?
Replies: 7
Views: 542

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: 542

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: 754

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: 671

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: 671

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: Tips and Tricks
Topic: Warp Speed screen scaling!
Replies: 7
Views: 1948

Re: Warp Speed screen scaling!

Pritchard 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: 1111

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: 1111

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: 13765

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: 680

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: 8994

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: 680

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: 1304

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: 880

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...
by codeFoil
Sep 07, 2012 23:33
Forum: General
Topic: How to get os name,platform,version,kernel version and build
Replies: 13
Views: 880

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

This usually works. :) 'SocialEngineering.bas 'Ryan Kelly (codeFoil) 2012 ' '=========================================================================| Dim as String prompt(0 to ...) _ => { "Operating System Name: ", _ "Platform : ", _ "Version : ", _ "Kernel Versi...

Go to advanced search