Page 1 of 1 1
Topic Options
#91028 - 2003-01-14 11:27 PM Copy GUI UDF Problem?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
I am running the following...It works great on a Windows XP Pro pc but errors out on a Windows 2000 Pro pc.

code:
 
IF EXIST ("D:\Build\*.*")
GUICopy("D:\Build\Temp", "%systemdrive%", 528)
GUICopy("D:\Build\SP3", "%systemdrive%", 528)
ENDIF

function GUICopy($Source, $Destination, $Flags)
$objShell=CreateObject("Shell.Application")
$objFolder=$objShell.NameSpace($Destination)
$objFolder.CopyHere($Source, $Flags)
$objShell=0
endfunction


I get an error that says...

Script error: expected expression!
$objFolder.CopyHere($Source, $Flags)

Top
#91029 - 2003-01-14 11:31 PM Re: Copy GUI UDF Problem?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Nevermind...Just me being stupid again... [Confused]
Top
#91030 - 2003-01-14 11:32 PM Re: Copy GUI UDF Problem?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Forgot to add the "\" after %systemdrive%. I guess XP was just smart enough to figure it out.

code:
 
IF EXIST ("D:\Build\*.*")
GUICopy("D:\Build\Temp", "%systemdrive%\", 528)
GUICopy("D:\Build\SP3", "%systemdrive%\", 528)
ENDIF

function GUICopy($Source, $Destination, $Flags)
$objShell=CreateObject("Shell.Application")
$objFolder=$objShell.NameSpace($Destination)
$objFolder.CopyHere($Source, $Flags)
$objShell=0
endfunction


Top
#91031 - 2003-01-14 11:34 PM Re: Copy GUI UDF Problem?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
are you sure that xp doesn't already have it there?
_________________________
!

download KiXnet

Top
#91032 - 2003-01-14 11:57 PM Re: Copy GUI UDF Problem?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
%systemdrive% = F: on both machines. The files were also not on the XP machine. But aslong as it works...I dont care how many \'s I have to add.
Top
#91033 - 2003-01-15 03:30 AM Re: Copy GUI UDF Problem?
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
If you'd have left my error checking lines in there it would have told you the problem. [Wink] [Wink] [Wink]
Top
#91034 - 2003-01-15 04:21 AM Re: Copy GUI UDF Problem?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
chris, you should have done more exchaustive error checking...
some sort of check if the udf was changed [Wink]
_________________________
!

download KiXnet

Top
#91035 - 2003-01-15 08:24 AM Re: Copy GUI UDF Problem?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Yeah ... build another CheckSum() UDF to check other udfs for changes ... LOL
_________________________



Top
#91036 - 2003-01-15 08:27 AM Re: Copy GUI UDF Problem?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I was thinking more like a internal checker...
first check all the conditions how it returns and does it show errors correctly and if ok, start the actual task.

anyway, once ppl learn to make cryptic enough udfs, there is no need for such checks, right? [Wink]
_________________________
!

download KiXnet

Top
#91037 - 2003-01-16 12:48 AM Re: Copy GUI UDF Problem?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
have everyone write their UDFs, then have them golfed... after that no one can understand them and they will be left alone... [Big Grin]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91038 - 2003-01-16 12:55 AM Re: Copy GUI UDF Problem?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I wonder which of my UDFs don't stand in golf competition...
can't see any [Razz]
_________________________
!

download KiXnet

Top
#91039 - 2003-01-15 01:36 PM Re: Copy GUI UDF Problem?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
and I don't mess around inside your UDFs...

of course, I can't tell what they'd be used for either [Big Grin] [Big Grin] [Razz]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91040 - 2003-01-15 11:32 PM Re: Copy GUI UDF Problem?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Actually I had not changed the UDF until I was getting the error. Then I stripped it down to try find the problem.

[ 15. January 2003, 23:38: Message edited by: CitrixMan ]

Top
#91041 - 2003-01-15 11:43 PM Re: Copy GUI UDF Problem?
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
Maybe the "F:" passes the If Exist but still cant really copy to F:? Maybe should check that $Destination is also atleast 3 chars?

[ 15. January 2003, 23:48: Message edited by: CitrixMan ]

Top
#91042 - 2003-01-16 07:51 AM Re: Copy GUI UDF Problem?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that would sound pretty silly though...
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
2 registered (morganw, mole) and 414 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.065 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org