Page 1 of 1 1
Topic Options
#92018 - 2003-05-14 08:04 AM unexpected error on "get $"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, actually it gives me unexpected error with every command that I call after this function:
code:
namethis('C:\test.txt')

function namethis($file)
dim $shell,$filename,$folder
$shell=createobject('shell.application')
if exist($file)
$folder=split($file,'\')
$filename=$folder[ubound($folder)]
$folder[ubound($folder)]=''
$folder=join($folder,'\')
else
exit 2
endif
$folder=$shell.namespace($folder)
$folder.parsename($filename).name
endfunction

get $

all it does is return the name of the file you input to it.
first thought that there was a bug with kix but then, that can't be, can it?

[ 14. May 2003, 14:06: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#92019 - 2003-05-14 02:03 PM Re: unexpected error on "get $"
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hmmm jlo, should this line:

$filename=$file[ubound($file)]

be more like this:

$filename=$folder[ubound($folder)]

-Shawn

Top
#92020 - 2003-05-14 02:06 PM Re: unexpected error on "get $"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
changed...
didn't bother testing.
_________________________
!

download KiXnet

Top
#92021 - 2003-05-14 02:07 PM Re: unexpected error on "get $"
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
and does it work ?
_________________________



Top
#92022 - 2003-05-14 02:10 PM Re: unexpected error on "get $"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
dunno, shawn provided the fix...

shawn, does it work?
_________________________
!

download KiXnet

Top
#92023 - 2003-05-14 02:14 PM Re: unexpected error on "get $"
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
what if you chnaged that last line, just before your EndFunction:

$namethis = $folder.parsename($filename)

-Shawn

[ 14. May 2003, 14:15: Message edited by: Shawn ]

Top
#92024 - 2003-05-14 02:14 PM Re: unexpected error on "get $"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
dunno what the heck is kix seeing there.

very similar code is used in rename UDF (basically the same, just done some recoding) and it works perfectly... AFAIK
_________________________
!

download KiXnet

Top
#92025 - 2003-05-14 02:18 PM Re: unexpected error on "get $"
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I dont think this line here is working properly, its returning an empty object:

$folder=$shell.namespace($folder)

? VarTypeName($Folder)

-Shawn

Top
#92026 - 2003-05-14 03:14 PM Re: unexpected error on "get $"
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
What exactly is the function supposed to be doing? It seems to be doing exactly what the code is trying to do.
_________________________
Eric

Top
#92027 - 2003-05-14 03:36 PM Re: unexpected error on "get $"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
do you mean that it works?
no errors?
_________________________
!

download KiXnet

Top
#92028 - 2003-05-14 03:38 PM Re: unexpected error on "get $"
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm ... you said 'returns' the name you feed it with

actually it should, as posted above, return nothing but maybe set error to 2 on failure [Confused]

What is it supposed to do anyway?

Sorry for me being stupido today [Frown]
_________________________



Top
#92029 - 2003-05-14 03:39 PM Re: unexpected error on "get $"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
if the file exists, it's name should be displayed on the console.
nothing more [Wink]
_________________________
!

download KiXnet

Top
#92030 - 2003-05-14 03:40 PM Re: unexpected error on "get $"
maciep Offline
Korg Regular
*****

Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
I don't get any errors. But all it does do is output the "text.txt".

kix ver: 4.21 rc2
os: xp pro
_________________________
Eric

Top
#92031 - 2003-05-14 03:43 PM Re: unexpected error on "get $"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeah, tested myself now too...
it works now.
so there was some syntax error which was corrected by shawns note or by mistake. [Big Grin]
_________________________
!

download KiXnet

Top
#92032 - 2003-05-14 03:46 PM Re: unexpected error on "get $"
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Console ?

what is this ?
_________________________



Top
#92033 - 2003-05-14 03:47 PM Re: unexpected error on "get $"
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
my cry for help...

maybe
_________________________
!

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
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.092 seconds in which 0.05 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