| View previous topic :: View next topic |
| Author |
Message |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun Dec 01, 2002 5:32 pm Post subject: |
|
|
Also another note:
As for the argument of rather
%X =
%A = @Null(%X)
is a Null is a matter for opinion. VDS treats an empty variable as a Null but in other languages an empty string has one charater in the string which is the Null terminating character or in VDS @chr(0). Also in other languages you cannot have a variable that has not been initialized to a value. Usually this would cause a warning or error because the language cannot figure out how to handle empty variables? On a PC all memory locations should have some value even if it is a null character. Because VDS is interpreted it can make exceptions to this rule. So this would mean that you will get the same result as above as you do with the line below.
%A = @Null()
Ok I think my head is about to explode with all of this stuff....hehehehehe
Isn't VDS cool  _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun Dec 01, 2002 5:54 pm Post subject: |
|
|
Ok now lets inspect the variables %A;%B;%C with the @ASC() function.
| FreezingFire wrote: | | Code: | %A = " "
%B = ""
%C =
%A = @len(%A)
%B = @len(%B)
%c = @len(%c)
info %a;%b;%c |
|
| Code: | %A = " "
%B = ""
%C =
info @ASC(%a);@ASC(%b);@ASC(%c)
%A = @len(%A)
%B = @len(%B)
%c = @len(%c)
info %a;%b;%c
|
VDS allocated a value for the variable %A but it did not for variable %B and %C.... _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sun Dec 01, 2002 7:04 pm Post subject: |
|
|
Also another note on the definition of NULL. The definition of NULL as stated by modern dictionaries is not nessisarily correct when it is applied to programming languages. The word NULL can have any value that the programmer that is building the language wants it to have.
For instance when I was building my Gadget.dll I had to consider this question. So I made a keyword called "NULL" and made it universal for all variable types. When the keyword "NULL" in gadget is applied to String variable types it refers to an empty string. When it is applied to Numeric variable types I defined it as the number 0. When it is applied to a Pointer variable type it is a Pointer to Void(ie...pointer to NULL). But when you use the NULL keyword as a return type from a function or if the function returns NULL I trapped it and made it return an empty string like most other VDS functions do.
My point is that I had other choices and it was strictly up to me how I wanted my DLL to handle a NULL. It is the programmers decision to stay within a definition of a variable type or to go outside the definition and be creative. J.M. Technical decided to make NULL = nothing within the language but outside the language if I inspect an empty Variable then I get a empty string and not nothing for the parameter being passed, it has the value of @chr(0).... So did we define NULL right? Well yes and no that is a very relative question and it should be put in context. Within the language of VDS yes we did but within other languages then no we prob. fuged a little. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
|