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 


Not sure if this is a bug or not (VDS 5)

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Jun 29, 2003 4:14 pm    Post subject: Not sure if this is a bug or not (VDS 5) Reply with quote

This is the main script:
Code:
#include Regn

rem %1 = 5
rem I remed out the %1 var to make a null value for %1.
%2 = 95
INFO Result is @Regn(%1,%2)

:close
stop


and this is the Regn.dsc file:
Code:
#define function, Regn

:Regn
  if @null(%1)
    WARN No value for first variable!
    rem Not working??? stop
    rem Not working??? exit
    rem When using stop the script should stop when the %1 variable is null. But the script just continues to display the info msgbox from the main script.
  else
    if @null(%2)
      warn No value for second variable!
      stop
    else
      %R = @sum(%1,%2)
    end
  end
exit %R


When I do a check for the variable %1 and %2, ( I have remed out the first var to make the error) and when using stop, the script should stop. Shouldn't it? I've tried with both stop and exit but nothing works.

_________________


Last edited by GeoTrail on Sun Jun 29, 2003 4:27 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jun 29, 2003 4:26 pm    Post subject: Reply with quote

This should work:

Code:
#include Regn

%a = 5
%b = 95
if @ok(@Regn(%a,%b))
INFO Result is @Regn(%a,%b)
end

:close
stop


Code:
#define function, Regn

:Regn
  if @null(%1)
    WARN No value for first variable!
    # set errorcode
    error 11
    # exit out of include
    exit
  else
    if @null(%2)
      warn No value for second variable!
    # set errorcode
    error 11
    # exit out of include
    exit
    else
      %R = @sum(%1,%2)
    end
  end
exit %R


Note that you don't have to use %1 & %2 when giving a function parameters.
These are special variables that will return the parameters. You should
actually avoid overwriting their data. Smile

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


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Jun 29, 2003 4:33 pm    Post subject: Reply with quote

Yeah, I know. The 1 and 2 names was just the first letters I saw on the keyboard Laughing

Anyways, when I run your mod in the IDE I get this error:
Quote:
Error: Missing argument(s) to function at line: 7 in file ...\Regn.dsc


Line 7 is:
Code:
error 11

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Jun 29, 2003 4:39 pm    Post subject: Reply with quote

Yes that was purposely done so that your script can recognize the error
if you're using OPTION ERRORTRAP. Error 11 is just that error and I
chose that one specifically. Wink

If you don't want it to do that just delete ERROR 11 Smile

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


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Jun 29, 2003 4:44 pm    Post subject: Reply with quote

ok, I removed both error 11 statements and now I see the message "No value for first variable!" twice and then the message "Result is" and no value.

Am I doing something wrong?
There were so many new things in VDS 5 that I've gotten completely confused. Laughing

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Sun Jun 29, 2003 5:59 pm    Post subject: Reply with quote

Er det mon fordi du bor i Bergen, at du opretter en funktion med navnet "Regn"???

Laughing Laughing

Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Sun Jun 29, 2003 10:53 pm    Post subject: Reply with quote

He he he latterkick.

I didn't see that you were from Denmark. Laughing
At first I thought you used a website to translate from English to Norwegian Smile

And yes, I called the function "Regn" because I was just experimenting with the include feature in VDS. I usually only write in english, but as this was only supposed to be a short and quick test, I used Norwegian. Laughing

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Jun 30, 2003 12:45 am    Post subject: Reply with quote

What does "Regn" mean in English? Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Mon Jun 30, 2003 6:14 am    Post subject: Reply with quote

Hey FF!

Getting curious, eh?

Well 'regn' just means 'rain' (in Norwegian and Danish) - and I was joking about Geotrail using that name for
a function, because the Norwegian town 'Bergen' where Geotrail lives has quite a reputation for having the
highest number of rainy days in all Scandinavia. I think it's raining there about 200 days every year Laughing Laughing
(please correct me if I'm wrong, Geotrail)

Probably G. wasn't thinking about the weather, however, because 'regn/regne' also means 'calculate'.

That's the end of today's language lesson Wink

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Mon Jun 30, 2003 8:38 am    Post subject: Reply with quote

No you are right Dr. Dread. But compared to London than Bergen is way down on the rainy list Laughing

Actually, Regn means several things. What I inteded it to mean was more of a math meaning. "Regn=Regning" which in english basically means calculas or math. I think Laughing

Anyways, Since I was making a simple math function I figured it would be a good name for the function hehehe

Oh yeah, thanks to Serge for helping me finding the bug in my program which I call Search Assistant. It's almost finished now, no it won't be open source. Besides, it's too simple for opensource Laughing

But it is my first program in VDS. I started on it when I used VDS 4.5 and I had some problems getting it to work in VDS 5. If you want to test it in it's current form let me know and I'll post a link. It is just a simple and quick way of doing searches. I have added 23 search engines in the program so you just type in a search term and select the engine of choice and click enter and it opens your default browser with the search engines page and result.

It also keeps tracks of the last used engine using registry and counts how many times each engine has been used along with a total counter for all engines. Wink It's very simple, and when I started it I didn't really know much about VDS. But the people who have tried it so far when it was wrking said it was a very usefull utility to have in the quick launch.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Mon Jun 30, 2003 8:45 am    Post subject: Reply with quote

Actually I do have one problem I want to fix.
I've added all graphix and external text files using #resource.
But if I do this:
Code:
SHELL OPEN,#license.txt
it don't work.
I just get an error about Windows not being able to find the file %license.txt

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Tommy
Admin Team


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

PostPosted: Mon Jun 30, 2003 9:41 am    Post subject: Reply with quote

See the helpfile: Reference Manual->Compiler Directives->#RESOURCE. There the commands
that will work with resources are listed. Commands not included in the list are not likely to be
capable of working with resources.

Chances are that this will work:

Code:

BINFILE SAVERES,TEXT,#license.txt,license.txt
SHELL OPEN,license.txt



If that wouldn't work, try omitting the "#" character.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Jun 30, 2003 12:56 pm    Post subject: Reply with quote

So does that mean I can essentially add a binary resource like:

Code:
#RESOURCE ADD,DLL,vdsinout.dll


Then extract it before I use it using:

Code:
BINFILE SAVERES,DLL,#vdsinout.dll,vdsinout.dll


Then use:

Code:
EXTERNAL vdsinout.dll


Or can I even just use:

Code:
EXTERNAL #vdsinout.dll

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


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

PostPosted: Mon Jun 30, 2003 3:00 pm    Post subject: Reply with quote

Quote:
The #RESOURCE directive allows you to specify files that are to be linked into the executable file as resources.

When the resource is used in a DIALOG ADD, DIALOG SET or LIST LOADFILE command, the filename must be prefixed by a '#' character.


'External' isn't mentioned, but I think it should work... Confused

_________________
[ 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
PGWARE
Web Host


Joined: 29 Dec 2001
Posts: 1565

PostPosted: Mon Jun 30, 2003 5:44 pm    Post subject: Reply with quote

No it won't work with that method. You need to extract the dll out before calling it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
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