| View previous topic :: View next topic |
| Author |
Message |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Jun 29, 2003 4:14 pm Post subject: Not sure if this is a bug or not (VDS 5) |
|
|
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 |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jun 29, 2003 4:26 pm Post subject: |
|
|
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.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Jun 29, 2003 4:33 pm Post subject: |
|
|
Yeah, I know. The 1 and 2 names was just the first letters I saw on the keyboard
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: _________________
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Jun 29, 2003 4:39 pm Post subject: |
|
|
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.
If you don't want it to do that just delete ERROR 11  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Jun 29, 2003 4:44 pm Post subject: |
|
|
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.  _________________
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Sun Jun 29, 2003 5:59 pm Post subject: |
|
|
Er det mon fordi du bor i Bergen, at du opretter en funktion med navnet "Regn"???
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Sun Jun 29, 2003 10:53 pm Post subject: |
|
|
He he he latterkick.
I didn't see that you were from Denmark.
At first I thought you used a website to translate from English to Norwegian
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.  _________________
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jun 30, 2003 12:45 am Post subject: |
|
|
What does "Regn" mean in English?  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Mon Jun 30, 2003 6:14 am Post subject: |
|
|
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
(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
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Mon Jun 30, 2003 8:38 am Post subject: |
|
|
No you are right Dr. Dread. But compared to London than Bergen is way down on the rainy list
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
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
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. 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 |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Mon Jun 30, 2003 8:45 am Post subject: |
|
|
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 |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Mon Jun 30, 2003 9:41 am Post subject: |
|
|
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 |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Mon Jun 30, 2003 12:56 pm Post subject: |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Mon Jun 30, 2003 3:00 pm Post subject: |
|
|
| 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...  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Mon Jun 30, 2003 5:44 pm Post subject: |
|
|
| No it won't work with that method. You need to extract the dll out before calling it. |
|
| Back to top |
|
 |
|