For ... Next loop in Assembler with VB code ?
Anyone know how to create a For ... Next loop in Assembler and place it into a VB program ? Is this possible to do ? If not, how can I create a ASM dll that accepts 3 Long's, lets say: Like having a For ... Next loop and inside this loop (ASM) call a VB function. Is this possible ?
Re: For ... Next loop in Assembler with VB code ?
I don't think so.
Why do you need it?
Re: For ... Next loop in Assembler with VB code ?
I don't think so.
Why do you need it?
Well, What I want is only to be able to put speed into VB loops. For ... Next loops are slower and if it is possible to do what I am waiting for, it will be great !
Don't you agree ?
Re: For ... Next loop in Assembler with VB code ?
Do-Loops are faster then For-Next but I don't know what you're doing so... :)
Re: For ... Next loop in Assembler with VB code ?
Loops are generally slowed by what is going on within them, rather than the loop itself. (oh, and calling a function, even from ASM, will be much slower).
A little tip, declare the loop variable as Long rather than Integer, it is faster ;)
If you post your code we can help find the 'problem'.
Re: For ... Next loop in Assembler with VB code ?
If you post your code we can help find the 'problem'.
I want to read a large random file with a UDT . Making a loop in VB it takes to much time (for me !) and then I remember that if it was possible to implement something using ASM to do the job, would be better. Like having a function with some parameters like: FirstRecord, LastRecord and UDT and then, read the #file and displaying results for example in a MsFlexGrid. It will be a great optimization ! And of course that integers are faster ! But sometimes we need longs !
Re: For ... Next loop in Assembler with VB code ?
I think my wording before confused you - Longs are faster than Integers ;)
I'm not sure, but I think having files with a UDT is quite slow (compared to text/binary files). Having a large file is obviously slow, and is probably what is causing the speed issue.
If you post the code, we can point out the parts of it that could be improved, and show you how to make it faster.
If your code is 'bad', using ASM won't make it much better - improving what you have is likely to make a much larger improvement.
Re: For ... Next loop in Assembler with VB code ?
If your code is 'bad', using ASM won't make it much better - improving what you have is likely to make a much larger improvement.
I believe my code is not so "bad" :) However, VB speed is not so good ! Try to manipulate graphics using pure VB code ! And don't know ASM but I know that - in some situations - we can call ASM code (a pre-compiled string) using CallWindowProc and this is very very fast ! This is the reason why - if possible - I would like to try something in ASM. I know that a question like this one is not usual, but I also know that some people have ASM knowledge and are also VB programmers ! I am only waiting for ... :) Thanks anyway !
Re: For ... Next loop in Assembler with VB code ?
Using assembler in VB is possible. You can find some info with Google "assembler vb".
If you understand German: ActiveVB
If it is worth for a loop?
Re: For ... Next loop in Assembler with VB code ?
Using assembler in VB is possible. You can find some info with Google "assembler vb".
Yes ! This is a answer ! Thanks ! I will have a search now !
:wave:
Re: For ... Next loop in Assembler with VB code ?
The only thing you will achieve trying to use ASM to optimise a For-Next loop is to go backwards rather rapidly from the calling overhead. There quite frankly is nothing much to optimise.
For maths, VB is very fast. The only reason you find it slower is because of the runtime DLL dependency, and the fact that your graphics algorithms are probably not very well optimised for VB.
Post any code you may have and we can try and improve it.
Re: For ... Next loop in Assembler with VB code ?
There is an AddIn for VB6 that allows you to use Inline assembly in your VB code:
http://www.planet-source-code.com/vb...62038&lngWId=1
That way there, you won't need external DLL calls. :)
Re: For ... Next loop in Assembler with VB code ?
There is an AddIn for VB6 that allows you to use Inline assembly in your VB code:
I Knew ! ... Someone, someday will came with some help ! That's it ! Thank's a lot ! :thumb: