Search found 254 matches

by codeFoil
Aug 27, 2012 23:17
Forum: General
Topic: self-casting ptr type
Replies: 11
Views: 759

Re: self-casting ptr type

There is where a vtable or an interface would come in. If all of your various UDT's support a set of methods, you could create a simple container object that would allocate a data object and store an array to the actual methods. In this case, all of your calling code would be dealing with just the c...
by codeFoil
Aug 26, 2012 21:58
Forum: General
Topic: Passing function ptr
Replies: 5
Views: 288

Re: Passing function ptr

The parameter 'inFunc' is also useless for just a declaration: Unrequired, yes, but used here for the purpose of literate code. In actual practice, I would have provided descriptive names for the parameters of the function as well to allow the header file containing the declaration to serve as docu...
by codeFoil
Aug 26, 2012 21:39
Forum: General
Topic: self-casting ptr type
Replies: 11
Views: 759

Re: self-casting ptr type

I considered something along those lines, but I do not know if we can guarantee that the correct method or member is accessed given changes in alignment or different implicit and explicit methods present. (I've done this in assembly, but never with a higher level compiled language.) The new inherita...
by codeFoil
Aug 25, 2012 23:41
Forum: General
Topic: Passing function ptr
Replies: 5
Views: 288

Re: Passing function ptr

That's a good way to put it!
by codeFoil
Aug 25, 2012 23:28
Forum: General
Topic: Passing function ptr
Replies: 5
Views: 288

Re: Passing function ptr

You still need the as keyword in the prototype.

Code: Select all

Declare  sub TestSub(inFunc as function(as Integer ptr, as Integer ptr) as Integer)


Without it, the compiler interprets the type identifier as a parameter identifier which it expects to be typed. Thus the error message.
by codeFoil
Aug 25, 2012 23:19
Forum: DOS
Topic: exec/chain/run performance loss
Replies: 10
Views: 2133

Re: exec/chain/run performance loss

Is the program you are executing from your program a real mode or protected mode program? Does it rely on real mode BIOS or DOS services?
by codeFoil
Aug 25, 2012 23:03
Forum: General
Topic: self-casting ptr type
Replies: 11
Views: 759

Re: self-casting ptr type

I also went down this road a few months ago and eventually found that the situation became incredibly cumbersome. I resorted to creating a reference type containing three members: a data pointer, a type code, and an instance count. A pointer to this type became the sole member of an object type with...
by codeFoil
Aug 25, 2012 22:16
Forum: Tips and Tricks
Topic: [Linux]CPU and RAM informations
Replies: 3
Views: 579

Re: [Linux]CPU and RAM informations

Sort and simple. Very easy to read. Comment: You could reuse the same variable to hold both file numbers since you close the first file before opening the second. file2 is not necessary. Question: Shouldn't you be able to open the kernel report files directly without bothering to dump them into new ...
by codeFoil
Aug 23, 2012 23:56
Forum: Beginners
Topic: Sleep macro?
Replies: 1
Views: 340

Re: Sleep macro?

KeyPgPpmacro #Macro PAUSE() Print "Strike any key." Sleep While Len(Inkey) : Wend #EndMacro PAUSE() Dim as String userInput Input "Input:", userInput Print userInput Since I wouldn't be concerned with the time expense of calling a subroutine in such a situation, I would do so.
by codeFoil
Aug 23, 2012 0:46
Forum: General
Topic: Open - share violation error
Replies: 4
Views: 407

Re: Open - share violation error

Elegant being subjective, I would say no. Even if you determined the status of the file before trying to open it, there is still the possibility that the file may be locked or even deleted before you open it. You would still have to check for an error while opening.
by codeFoil
Aug 22, 2012 0:06
Forum: General
Topic: "offset" cannot be used as a variable, why?
Replies: 9
Views: 740

Re: "offset" cannot be used as a variable, why?

In the good ole bad ole days we used to have programming books, these used to list ALL the words alphabetically 1 up: old programming books we sometimes forget the value of a simple list of words. And we also forget the value of a table of contents. http://www.freebasic.net/wiki/wikka.php?wakka=Doc...
by codeFoil
Aug 21, 2012 2:05
Forum: General
Topic: Why kill ? and not delete or del ?
Replies: 31
Views: 2703

Re: Why kill ? and not delete or del ?

Code: Select all

Print
by codeFoil
Aug 19, 2012 3:12
Forum: Community Discussion
Topic: Back2BASIC #7
Replies: 7
Views: 941

Re: Back2BASIC #7

Somehow, the smaller amount of content actually made that issue really nice to read. angros47's article on LCD pixels was great.
by codeFoil
Aug 18, 2012 20:01
Forum: Documentation
Topic: Sleep RESOLVED
Replies: 9
Views: 2608

Re: Sleep RESOLVED

Though the current return value of the function form isn't really useful, I don't consider it a high priority change. It would be best to simply make sure the documentation matches the actual behavior. Changing them both to a sub would not be bad choice either. It would be consistent with the histor...
by codeFoil
Aug 17, 2012 23:24
Forum: General
Topic: 'Branch crossing local variable definition' (fbc message)
Replies: 7
Views: 704

Re: 'Branch crossing local variable definition' (fbc message

I imagine the warning serves to alert you situations such as that which is created by this Dim as String whichCase Input whichCase Select case LCase(whichCase) Case "string" Dim as String strVal Input strVal If strVal = "leap" Then Goto Across Print strVal Case "int" Di...

Go to advanced search