Search found 225 matches

by RockTheSchock
Dec 07, 2007 13:38
Forum: General
Topic: How to compare pairs of integers?[solved]
Replies: 12
Views: 2521

Faster compare with asm

On my p3 my version runs faster: cycles 49 - 16 - 13 Dim As Integer a=2,b=1,j=1,k=2 Screen 0 counter_begin( 1000, HIGH_PRIORITY_CLASS ) if ((a=j) and (b=k)) or ((a=k) and (b=j)) Then asm nop End If counter_end Print counter_cycles; " cycle...
by RockTheSchock
Nov 23, 2007 17:17
Forum: General
Topic: have a whack at improving my arraybuffer_add sub
Replies: 9
Views: 2088

I don't understand your code

Sorry, but what does your code? I guess, it's only extending the Array if it's needed. Why you don't use a linked list of arrays and from time to time you make one bigger Array copying and erasing the others in the linked list. If you use OOP you could implement some cool things overloading operators.
by RockTheSchock
Nov 23, 2007 15:21
Forum: Beginners
Topic: Shared or reallocating : Wich is faster?
Replies: 13
Views: 3083

Initialising Array with Any

Try this to initialise array to any. Dim a(9) As Integer => Any It seems to work. This little testcode shows that it works with dynamic arrays to and even with Redim Preserve Dim i As Integer Dim As Integer Ptr pa,pb ReDim b(9) As Integer For i = LBound(b) To UBound(b) b(...
by RockTheSchock
Nov 17, 2007 14:52
Forum: General
Topic: Swapping an array
Replies: 10
Views: 2595

Better Version of swaparrays macro

#Macro SwapArrays(arr,arr2) Scope #If ( TypeOf(arr)=TypeOf(arr2) ) Asm lea eax,[a] 'the adress of the array descriptor begins lea ebx,[b] 'at [a-32]. Begin to swap at the tail 'of the array descriptor mov ecx,8 '32 bytes 8 * dword swaploop: 'swap array descriptors mo...
by RockTheSchock
Nov 17, 2007 4:29
Forum: General
Topic: Swapping an array
Replies: 10
Views: 2595

Macro swapping Arrays

I am tired after 5 hours. I think it works without problems. I know that calling memcopy is ugly but it's 5am. After sleeping i will code this little step. Perhaps there will be someone else finished first. #Include "crt.bi" #Macro SwapArrays(arr,arr2) Scope #If ( TypeOf(ar...
by RockTheSchock
Nov 16, 2007 14:25
Forum: General
Topic: Swapping an array
Replies: 10
Views: 2595

Swapping an array

I want to swap an array wether array1 = array2 nor swap(array1,array2) are working i don't want to copy the arrays, I only want to swap the array descriptors ReDim newlist(1000) As String ReDim filelist(1000) As String Dim changed As String getFiles("*.*",&h21, file...
by RockTheSchock
Nov 13, 2007 14:43
Forum: Game Dev
Topic: Game Development: Square One
Replies: 19
Views: 8573

I've never Programmed an RPG because there are so many of them. But I've a guideline for you. Perhaps you know this stuff yet 1. Seperate game logic and data from output and design. 2. Make thinks as easy and short as possible AND easy to extend 3. If you have never done something make a plan. If yo...
by RockTheSchock
Oct 11, 2007 20:45
Forum: General
Topic: Using Eclipse SWT with FreeBasic
Replies: 1
Views: 1146

Using Eclipse SWT with FreeBasic

The SWT is used by some Java applications like Eclipse as WindowingToolkit. it's like wxWidgets. It should have on all Plattforms the same features like Buttons,TextAreas Labels etc. If one is missing for a specific plattform it is emulated there. There exists a static compiled version. http://www.t...
by RockTheSchock
Sep 20, 2007 12:20
Forum: General
Topic: generate new functions at runtime?
Replies: 10
Views: 3078

dll Generation at runtime

You can generate with the freebasic compiler dll's and include them dynamically at runtime. But you must bundle your software with the FBCompiler and then your Software has to be put under GPL, too, if it depends on that feature. (I am not totally sure if this interpretation of the GPL is right.) Th...
by RockTheSchock
Jun 09, 2007 14:55
Forum: General
Topic: smallest .exe file sizes
Replies: 16
Views: 4462

4,956 Byte Hello World Programm with PDQ.LIB

Does anyone know this lib for QuickBasic. http://www.ethanwiner.com/p_pdq.htm It would be nice if someone asks Ethan Winer if he publishes the code under GPL. .EXE File Size Comparisons P.D.Q. QC 2.0 TC 2.0 TP 5.5 QB 4.5 NumOff Utility 418 2,371 990 2,845 10,325 Hello Program 754 5,363 3,958 3,260 1...
by RockTheSchock
May 04, 2007 11:33
Forum: General
Topic: Let's Have Some Fun
Replies: 52
Views: 9612

Calculating factorials

Calculating factorials: 5000! = A number with 16326 digits No Problem! Try this! 245 Bytes DEFINT A-Z:CONST Z=99999:DIM f(Z):f(Z)=1:r=1:Input n FOR i=1 TO n:FOR k=Z-r TO Z:f(k)=f(k)*i:NEXT DO:k=k-1:f(k-1)=f(k-1)+f(k)\10:IF f(k-1) AND Z-...
by RockTheSchock
Apr 13, 2007 15:43
Forum: General
Topic: Port CGUI to FreeBasic
Replies: 1
Views: 1049

Port CGUI to FreeBasic

What do you think of porting CGUI to FreeBasic. Why? Because existent Windowing Toolkits are very large. CGUI and Allegro dlls > 1MB. QT, GTK ... are even larger. Wouldn't it be nice to link the windowing toolkit statically without the need of dlls. The size increase should be less then 200kb. With ...
by RockTheSchock
Mar 12, 2006 21:15
Forum: General
Topic: Feature Request: Methods in Types
Replies: 6
Views: 1367

Think about the code above as suggestion

What you have shown Shadowolf I've already used on my own in one of my projects. It disturbs me that in every Procedure I must add an extra parameter "this as ... ptr" and I have to set the Pointer to a procedure. It's just an idea, how the compiler could be extended with OOP. I wanted to hear what ...
by RockTheSchock
Mar 12, 2006 16:53
Forum: General
Topic: Feature Request: Methods in Types
Replies: 6
Views: 1367

Feature Request: Methods in Types

Wouldn't it be nice to have more object oriented TYPE's? if you could write: TYPE wndObject x AS INTEGER y AS INTEGER PRIVATE title AS STRING 'private: only accessible from Method ... ... ... SUB paintALL() 'new Type Methods print this->title 'this as new Keyword in Methods END SUB END TYPE ...

Go to advanced search