@Accel Leon, just a few quick general DB-related pointers::
Translation: This is why your code is borked
Val() returns an integer, and is one way ONLY.
Where you do:
Quote: "
val(Pass$) = net pop float()
val(Name$) = net pop float()
"
.. isn't valid. You cannot assign a floating point integer representation to a function like that; They're one way.
Val() is designed ONLY to return an integer, from a string you pass.
And another thing on the use of Val(); It reads the string and tries to turn it into a number.
You attempt to use the code as if to turn the string into an integer represenation, and then back again; You cannot do this.
Val()'s designed for parsing integers that are written into strings; Like Val("12345") would return an integer with the value 12345. That's all.
It can't do miracles
---
Ook, and ints in general:
Quote: "
Function SendOk()
Number# as integer
OK# as integer
Number#=val("2")
OK#=val("Account created,you can now login")
net push float Number#
net push float OK#
net send 1
inc PACKETS_SENT
endfunction"
Let's work through this. I won't touch the MultiSync-specific stuff, as that's Benjamin's domain.
'Number# as integer' DOES NOT make sense. # means that the number is a float; Float(ing point integer) != (normal) Integer.
The #,$ symbols effectively mean 'as float' and 'as string' respectively.
You use either the symbols on the end of the vars (have to in DBC), OR the as <type> declaration.
So:
Number as integer
Will do you fine. ^^
-----
Quote: "
OK# as integer
Number#=val("2")
OK#=val("Account created,you can now login")
"
Hopefully you should see where you're going wrong with this bit now
Number#=val("2")? Technically valid code, but you don't want Number# as a float because you haven't got a decimal point.
Numbers without decimal points, use Integers.
Quote: "
Number as integer
Number = 2
"
Val() only needs to be used for very special cases (finding numbers in written text). Just use the above code, as you can assign integers directly to their values!
And, finally, OK#.
You imply it's a float by using #, you use 'as integer' to contradict yourself and say it's actually an integer... And then you assign a string's value to it. o_o
OK As String, or OK$.
Remember that in DB you don't have to declare your variables! It's good practise, but you don't need to.
Both of the following are correct (but require that you choose what to call your var, depending on your style (or lack of it)):
Methos 1
Quote: "
OK As String
OK = "Account created, you can now login."
"
Methos 2
Quote: "
Rem Variable implicitly declared
OK$ = "Account created, you can now login."
"
Well, have fun! Fixing up the rest of your code in this manner will fix the problem anyway, I think....
Because you know how Val() pulls written numbers out of text?
What happens if you use Val("SomeWriting")?
0, that's what.
Well. Enjoy.
-=-=- Activate asshat mode. -=-=-
Warning: This post may contain bloatage.