by ゲスト » 2009年1月03日(土) 08:09
ver424で下記のようにして使ってます。
以前に凡そで造ったので、何か変な気がしていますが動いてます。
function filesplit(tes as string,k as word) as string
dim drv as BytePtr ,dir as BytePtr ,fna as BytePtr ,ext as BytePtr
dim ppath as BytePtr
drv=malloc(8)
dir=malloc(255)
fna=malloc(128)
ext=malloc(8)
ppath=calloc(512)
_splitpath(tes,drv,dir,fna,ext)
select case k
case 1
lstrcat(ppath,drv)'
lstrcat(ppath,dir)'
case 2
lstrcat(ppath,fna)'
lstrcat(ppath,ext)'
end select
ppath[lstrlen(ppath)]=0
filesplit=MakeStr(ppath)
end function
ver424で下記のようにして使ってます。
以前に凡そで造ったので、何か変な気がしていますが動いてます。
function filesplit(tes as string,k as word) as string
dim drv as BytePtr ,dir as BytePtr ,fna as BytePtr ,ext as BytePtr
dim ppath as BytePtr
drv=malloc(8)
dir=malloc(255)
fna=malloc(128)
ext=malloc(8)
ppath=calloc(512)
_splitpath(tes,drv,dir,fna,ext)
select case k
case 1
lstrcat(ppath,drv)'
lstrcat(ppath,dir)'
case 2
lstrcat(ppath,fna)'
lstrcat(ppath,ext)'
end select
ppath[lstrlen(ppath)]=0
filesplit=MakeStr(ppath)
end function