Well, I've taken a look at the code now. Beyond the complete lack of formatting, there seems to be quite a lack of consistency in terms of casing. I can't remember if DBPro is case-sensitive with variable names or not. If it is then your code definitely won't do as you expect as you would be basically referencing an new uninitialised variable each time you change the casing you reference it by and hence getting a 0 value. For example, your code has "reducerB" and "reducerb".
You also seem to be declaring a lot of "contants", by which I don't mean that you are using the "#constant" syntax but that you have hard-coded numeric values which without descriptions mean nothing to me really. The only one you have given a name to is misleading because you've defined "pi" as "576" which again doesn't make much sense.
In case someone else is willing to take a look, I've tried to format and standardise the casing as much as I could without spending too long on this and have put it in code tags below for people that can't be bothered to download an RTF file just to look at some code (understandably).
x = 3
y = 3
z = 128
booleancheck = 0
T = tevarcT(y, x)
print T
U = getUZ(z)
print U
comT = T
comU = U
if (u < 32)
if (T > 256)
const = 64
endif
if (T > 1024)
const = 128
endif
if (T > 4096)
const = 128
endif
if (T > 16384)
const = 128
endif
if (T = 65536)
const = 256
endif
reducer = T %% const
reducerB = int(T * 1.0 / const)
if (reducerB > reducer and reducer > sqrt(const))
comT = reducer
booleancheck = 1
k = reducer - reducer %% (const / 16)
mval = reducerB - reducer + reducer %% (const / 16)
else
if (reducer > reducerB and reducerB > sqrt(const))
booleancheck = 0
comT = reducerB
k = reducerB - reducerB %% (const / 16)
mval = reducer - reducerB + reducerB %% (const / 16)
else
mval = reducer
comT = reducerB
endif
endif
comU = U
else
if (U > T)
checkgx = T
else
checkgx = U
endif
if (T > 256)
const = 64
endif
if (checkgx > 32)
const = 128
endif
if (checkgx > 64)
const = 128
endif
if (checkgx > 128)
const = 128
endif
if (checkgx = 256)
const = 256
endif
reducer = U
reducerB = T
if (reducerB > reducer and reducer > sqrt(const))
comU = reducer
booleancheck = 1
k = reducer - reducer %% (const / 16)
comT = reducerB - reducer + reducer %% (const / 16)
else
if (reducer > reducerB and reducerB > sqrt(const))
booleancheck = 0
comT = reducerB
k = reducerB - reducerB %% (const / 16)
comU = reducer - reducerB + reducerB %% (const / 16)
else
comU = reducer
comT = reducerB
endif
endif
endif
if (mval > 0)
if (booleancheck = 1)
UVALS = comU
jklmn = comT
holdbn = (mval+k)
cccount = 0
repeat
jklmn = jklmn / 2
cccount = cccount + 1
until (jklmn < 1.1)
VVALS = (2 ^ cccount) * holdbn + comT
else
VVALS = comT
jklmn = comU
holdbn = (mval + k)
cccount = 0
repeat
jklmn = jklmn / 2
cccount = cccount + 1
until (jklmn < 1.1)
UVALS = (2 ^ cccount) * holdbn + comT
endif
else
if (booleancheck = 1)
UVALS = comU
jklmn = comT
holdbn = (comT + k)
VVALS = holdbn
else
VVALS = comT
jklmn = comU
holdbn = (comU + k)
UVALS = holdbn
endif
endif
print UVALS
print VVALS
qpc = getUZ(UVALS)
print getXXX(VVALS)
print getYYY(VVALS)
print getUZ(UVALS)
repeat : until (shiftkey() = 1)
end
function tevarcT(y, x)
value# = y * 1.0 / x
pi# = 3.1415
if (abs(value) > 1)
ans = value# * 1.0 / (1 + 0.28 * value# ^ 2) * 512.0 / pi# + 1024 * sqrt(y ^ 2 + x ^ 2) / sqrt(2)
else
ans = (pi# / 2 - value# * 1.0 / (1 + 0.28 * value# ^ 2)) * 512.0 / pi# + 1024 * sqrt(y ^ 2 + x ^ 2) / sqrt(2)
endif
endfunction ans
function getYYY(T)
const = 576
y = (int(T / const) * sin(T * 90.0 / 256))
endfunction y
function getXXX(T)
const = 576
x = (int(T / const) * cos(T * 90.0 / 256))
endfunction x
function getUZ(z)
U = 252 - z
endfunction U
If you're able to give more description or a graphical representation then I'll take a look for you again but I'm afraid I'm a bit lost from the wording and code example given so far.
P.S - Just for reference, the current output of the code is:
3200
124
124
3200
3
3
128
[Edit] Setting language of code tag. [/Edit]

Previously TEH_CODERER.