#37126 - 2003-02-28 05:34 PM
"Return" messing up my USE command
|
Anonymous
Anonymous
Unregistered
|
I am using Kixtart 4.12 on Windows 2000 and am having a problem with USE. Here is the script: code:
$letter = "G:" $path = "\\yeg01-nts-04\it_drive" Gosub mapdrive
...
:mapdrive $map = $map + 1 AT ($map,0) "Connecting to $path as $letter Drive" Use $letter "$path" Return
code:
The message that I get when I run this script is "Script error: error in use statement! Return". Is there any way to make it so the "Use" doesn't think that the Return statement is part of it's arguments?
|
|
Top
|
|
|
|
#37129 - 2003-02-28 06:01 PM
Re: "Return" messing up my USE command
|
Anonymous
Anonymous
Unregistered
|
OK that's cool. I posted the wrong code with the quotation marks around my last variable in the use statement. I had changed it once I started to troubleshoot.
I was just wondering if you could elaborate on why a UDF is better than a gosub. Are they more efficient with memory? I use the gosub to cut down the # of lines in the script, but am wondering if there is a performance or other gain from using a UDF.
Ooooh! I didn't even see that I missed the Exit statement!!! Ooops! Sorry to waste your time! [ 28. February 2003, 18:08: Message edited by: Kellar ]
|
|
Top
|
|
|
|
#37132 - 2003-02-28 06:40 PM
Re: "Return" messing up my USE command
|
Anonymous
Anonymous
Unregistered
|
Thanks for the offer for future tasks.
I think I understand from the UDF link posted by sealeopard, so I'm going to give my first UDF a shot and see how it goes. Thanks to both of you for the help.
|
|
Top
|
|
|
|
#37134 - 2003-02-28 07:13 PM
Re: "Return" messing up my USE command
|
Anonymous
Anonymous
Unregistered
|
Well I intended to see if I could get the job done by figuring it out by myself just to see if I could be. However, now that I get right down to it, I'm going to have to just that and look at some previous examples since I don't know how to start the UDF.
|
|
Top
|
|
|
|
#37135 - 2003-02-28 07:55 PM
Re: "Return" messing up my USE command
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
|
|
Top
|
|
|
|
#37136 - 2003-02-28 09:52 PM
Re: "Return" messing up my USE command
|
Anonymous
Anonymous
Unregistered
|
Thanks Howard, it helps to see a complete example. I can really see how the script is structured with the function in it.
I should also mention that your site is in my bookmarks now too! It's quite handy with the page containing all of the UDF's.
|
|
Top
|
|
|
|
#37138 - 2003-02-28 09:56 PM
Re: "Return" messing up my USE command
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I think that the UDFs are on Lonkero's or NTDOC's sites. I have Perl and other admin stuff on mine. ![[Smile]](images/icons/smile.gif) [ 28. February 2003, 21:56: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 302 anonymous users online.
|
|
|