Open Forum > What's New

ScriptBasic 3.0 Open Items

<< < (2/6) > >>

Airr:
Not sure how Peter originally envisioned these, but I can tell you how it's set in MBC/BCX/etc (hope you don't mind).

CVI - signed short return value

MKI - signed short parameter, 2-byte fixed length string return value.

Even though it's old and not C, you might want to look at This Old MS KB Article for some tips.

Writing those functions is really simple; we use memmove in place of the hmemcpy Microsoft suggests in the article, and of course C instead of VB for the actual functions....

A.

mesbas:
I can see returning a signed short for the CVI.
The argument string will have to be between "-32768" and "32767".
Those are the min and max for a signed short.

Going back using MKI can't be limited to a 2 byte return value.
How do you represent the number 32767 as a 2 byte string?
A 2 byte string could only contain numbers from -9 to 99.

Maybe I'm a little confused, how can you stuff a 5 character string into a 2 character container.

Tom

PS

OK, OK, OK
I got it now!!!

The MKI function and the CVI function are compliments to each other.
The 2 byte string created by MKI is a representation of the number, and not meant to be readable by a human.

I see the light!!  Thank you Airr.

mesbas:
Something to ponder after we ring in the new year.

Regarding the, yet to be implemented, TAN() function:
This function historically gives you the tangent of an angle measured in radians.
   Eg:  tangent = TAN(radians)

Since most angles are measured in degrees, another function is needed to convert degrees to radians.
   Eg:  radians = RAD(degrees)

So……  We can either change the definition and functionality of our TAN() function, to accept degrees directly, or add a new RAD() function.

If we change the TAN() function to use degrees directly, what happens to those folks that only have the radians value?  Do we add another function to convert radians to degrees?

My vote is to create the new RAD() function.
I,m not a mathematician so guidance is requested.

Support:

--- Quote from: Tom ---My vote is to create the new RAD() function.

--- End quote ---

+1

mesbas:
I created the new RAD() function.
I also implemented 11 of the unimplemented math functions.
How do I submit the code for testing?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version