forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Error 25...
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 23, 2002 11:21 pm    Post subject: Error 25... Reply with quote

Hi all,

I was just making a boring program to valide 'postbank' numbers, when I hit a real strange error. It says that the number is Non-numeric... Can't find the mistake, so I think it is be a bug...

Code:
%%pasnummer = 523456789
%z = 1
repeat
%%number = @prod(@substr(%%pasnummer,%z,%z),%z)
%%test = @fadd(%%number,%%test)
%z = @succ(%z)
until @equal(%z,9)

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat Nov 23, 2002 11:45 pm    Post subject: Reply with quote

Try replacing the @prod() with the floating point equivalent instead. which
is what, @fdiv()?.

-Garrett
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sat Nov 23, 2002 11:48 pm    Post subject: Reply with quote

No bug...

You forgot to init %%test with a value.

I'm moving this to the General Help Section,
we should post suspected bugs there first...

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Nov 24, 2002 12:02 pm    Post subject: Reply with quote

Hi Mac,

If you are doing maths, and you have a sum like this:

X =
Y = X + 1

Then the answer is 1. But why does VDS need a X = 0? That a little strange, isn't it?

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Nov 24, 2002 12:15 pm    Post subject: Reply with quote

Not really, but you can use empty vars if you're
not using floating point math functions... Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Sun Nov 24, 2002 5:08 pm    Post subject: Reply with quote

If using loops, it is a good practice with any programming language to initialize all
variables which will be used in the loop.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Tsunami1988
Contributor
Contributor


Joined: 15 Aug 2002
Posts: 70
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 6:40 pm    Post subject: Reply with quote

skit3000 wrote:
Hi Mac,

If you are doing maths, and you have a sum like this:

X =
Y = X + 1

Then the answer is 1. But why does VDS need a X = 0? That a little strange, isn't it?

this is because
Code:
X =
sets X to null, not 0.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
DoT_PiTcH
Contributor
Contributor


Joined: 07 Aug 2002
Posts: 85

PostPosted: Sun Dec 01, 2002 2:26 am    Post subject: Reply with quote

not nessisarily

X =
could mean x = anything
like in pascal, there is no standard....
i believe VDS is this way to considering it was writing in delphi(OO pascal)
Back to top
View user's profile Send private message Visit poster's website
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Sun Dec 01, 2002 3:38 am    Post subject: Reply with quote

Not necessarily, in Delphi variables are defined by types (strings, integers, etc) in VDS they are all strings even if they contain only numbers it's still evaluated as a string.
Back to top
View user's profile Send private message
Tsunami1988
Contributor
Contributor


Joined: 15 Aug 2002
Posts: 70
Location: The Netherlands

PostPosted: Sun Dec 01, 2002 10:22 am    Post subject: Reply with quote

DoT_PiTcH wrote:
not nessisarily

X =
could mean x = anything
like in pascal, there is no standard....
i believe VDS is this way to considering it was writing in delphi(OO pascal)

it could be, but I believe that
Code:
X =
sets X to null.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Dec 01, 2002 2:28 pm    Post subject: Reply with quote

Try this script:

Code:
%X =
if @equal(%X,0)
warn "%X = 0"
end
if @null(%X)
warn "%X is null"
end
exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Tsunami1988
Contributor
Contributor


Joined: 15 Aug 2002
Posts: 70
Location: The Netherlands

PostPosted: Sun Dec 01, 2002 2:38 pm    Post subject: Reply with quote

FreezingFire wrote:
Try this script:

Code:
%X =
if @equal(%X,0)
warn "%X = 0"
end
if @null(%X)
warn "%X is null"
end
exit

I told you it was null Razz
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sun Dec 01, 2002 5:03 pm    Post subject: Reply with quote

Actually all,
VDS does not allocate an empty variable and this can be proven with a simple VDS script.
Consider the following code.
Code:

%Y = 2
%X =
%Z = @Prod(%Y,%X)
Info Z = %Z@Cr()Y = %Y@Cr()X = %X
Rem Now lets inspect each variable
Info The Length of Z = @Len(%Z)@CR()ASCII value of Z = @ASC(%Z)
Info The Length of Y = @Len(%Y)@CR()ASCII value of Y = @ASC(%Y)
Rem The next line should give you an error after the Info box is shown
Info The Length of X = @Len(%X)@CR()ASCII value of X = @ASC(%X)


Not that this is a bug in VDS but rather this: A VDS floating point function has to make sure that the values passed to it is numeric becuase of the decimal point or comma. I am no Math expert but is this not true Value times Nothing is still nothing right, Value plus Nothing is Value, Value minus Nothing is Value? Now if you tried Value divided by Nothing you will get a VDS error 26 "Arithmetic error" and that is because you cannot divide by nothing....So in the case of division this is an underflow error but not a divide by zero error eventhough VDS treats both with the same error number.

And there you have the rest of the story Wink

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Sun Dec 01, 2002 5:22 pm    Post subject: Reply with quote

I think in math you use 0 as the equivalent to 'nothing', in vds if you use a blank variable x = " " that simply is not the same as using 0.
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Dec 01, 2002 5:27 pm    Post subject: Reply with quote

%A = "" is the same thing as %A =
You can see the length of that, zero indicating a length of zero characters, meaning "null". Here's a quote taken from dictionary.com:
Null is defined as "Zero; nothing," so in this case, the length of the var without data is returned "zero".

Code:
%A = " "
%B = ""
%C =

%A = @len(%A)
%B = @len(%B)
%c = @len(%c)

info %a;%b;%c

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group