Attached is a tiny DLL with an Xbasic script to test.
If you are not an experienced Xbasic programmer, don't bother. If you want to see Xbasic from the inside out, you might have fun. This gives you an idea of how fast/slow various Xbasic commands are.
There are some test functions that indicate the time overhead in calling a DLL function. And there are two useful functions:
- StrLen as N() is a clone of len(); due to DLL overhead, it doesn't get faster except for longer strings (> 2,000 bytes?). Outside of A5, it can count 4 billion characters per second.
- RepChar as C(AsciiVal as N, Count as N) is MUCH FASTER than replicate(), but can only replicate a single character. Due to limitations of A5's design, the replicated string is limited to 1023 bytes (although it will actually replicate as many as 1 million internally - you can time it to get an idea).
If you are so inclined, please test this and give me feedback. If there is some function you would like me to create, please let me know.
To install, copy ExternDLL.dll to the directory where your version of AlphaFive is installed. Copy the .TXT file to a new Xbasic script, and you should be good to go.
It should work with all versions of A5, and should work in any Windows OS and any 32-bit CPU. Builds prior to 4050 will not work properly with the StrLen() command on strings 1k or greater in length. And A5 current limits the length of a string passed from a DLL to Xbasic to a maximum of 1023 characters.
Thanks,
Eric
If you are not an experienced Xbasic programmer, don't bother. If you want to see Xbasic from the inside out, you might have fun. This gives you an idea of how fast/slow various Xbasic commands are.
There are some test functions that indicate the time overhead in calling a DLL function. And there are two useful functions:
- StrLen as N() is a clone of len(); due to DLL overhead, it doesn't get faster except for longer strings (> 2,000 bytes?). Outside of A5, it can count 4 billion characters per second.
- RepChar as C(AsciiVal as N, Count as N) is MUCH FASTER than replicate(), but can only replicate a single character. Due to limitations of A5's design, the replicated string is limited to 1023 bytes (although it will actually replicate as many as 1 million internally - you can time it to get an idea).
If you are so inclined, please test this and give me feedback. If there is some function you would like me to create, please let me know.
To install, copy ExternDLL.dll to the directory where your version of AlphaFive is installed. Copy the .TXT file to a new Xbasic script, and you should be good to go.
It should work with all versions of A5, and should work in any Windows OS and any 32-bit CPU. Builds prior to 4050 will not work properly with the StrLen() command on strings 1k or greater in length. And A5 current limits the length of a string passed from a DLL to Xbasic to a maximum of 1023 characters.
Thanks,
Eric
Comment