-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Postpemanggilan frame(4)
 by nasbms
 on 19.May at 16:14
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14
goto Posttanya biner to matriks(13)
 by diandewi
 on 14.May at 20:30

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 4 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 4 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
fcomputerOffline
Location:
20 Post subject: Sepele tapi GAGAL!!  PostPosted: 20/Sep/2009 14:23
onNovice


Joined: 20-Apr-2009
Posts: 14

Status: Offline
Haduwh2, nie q ada permasalahan tentang bagaimana cara merubah Long FileName ke ShortFileName (DOS), dah Q cari2 n nemu code ini, tapi waktu Q coba tetep gag bisa, apa ada yang salah?? Delphi saya 7.0

      Code:

function GetShortName (const FileName: string): string;
var aTmp: array[0..255] of char;
begin
  if not FileExists (FileName) then
    Result := ''
  else if GetShortPathName (PChar (FileName), aTmp, Sizeof (aTmp) - 1) = 0
  then
    Result:= FileName
  else
    Result:= StrPas (aTmp);
end;
 
 View user's profile Send private message  
Reply with quote Back to top
pebbieOffline
Location: di dapur
Post subject: RE: Sepele tapi GAGAL!!  PostPosted: 20/Sep/2009 14:49
onUber-Skilled


Joined: 16-Sep-2006
Posts: 459
Location: di dapur
Status: Offline
kok pake sizeof? bukannya pake length?
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
fcomputerOffline
Location:
Post subject: RE: Sepele tapi GAGAL!!  PostPosted: 20/Sep/2009 14:51
onNovice


Joined: 20-Apr-2009
Posts: 14

Status: Offline
Mungkin kayag gini??

      Code:

function GetShortName(sLongName: string): string;
var
  sShortName:    string;
  nShortNameLen: Integer;
begin
  SetLength(sShortName, MAX_PATH);
  nShortNameLen := GetShortPathName(PChar(sLongName), PChar(sShortName), MAX_PATH - 1);
  if (0 = nShortNameLen) then
  begin
  showmessage('Error!');
  end;
  SetLength(sShortName, nShortNameLen);
  Result := sShortName;
end;
 
 View user's profile Send private message  
Reply with quote Back to top
fcomputerOffline
Location:
Post subject: RE: Sepele tapi GAGAL!!  PostPosted: 20/Sep/2009 15:00
onNovice


Joined: 20-Apr-2009
Posts: 14

Status: Offline
Ini juga gagal..
 
 View user's profile Send private message  
Reply with quote Back to top
safariOffline
Location:
Post subject: RE: Sepele tapi GAGAL!!  PostPosted: 21/Sep/2009 07:07
onConfident


Joined: 13-Aug-2009
Posts: 28

Status: Offline
Coba aja Gogling ini:

http://www.google.co.id/#hl=id&sour ... f733d7a7f8
 
 View user's profile Send private message  
Reply with quote Back to top
aday-gate
Location: Tangerang-Banten
Post subject: RE: Sepele tapi GAGAL!!  PostPosted: 22/Sep/2009 06:48
onConfident


Joined: 23-Jul-2009
Posts: 29
Location: Tangerang-Banten
pake fungsi "extractfilename" ajah coba... Confused javascript:emoticon('Confused')

_________________
"Newbie 4ever!!!"
 
 View user's profile Send private message Visit poster's website Yahoo Messenger  
Reply with quote Back to top
PenjahatOffline
Location:
Post subject: RE: Sepele tapi GAGAL!!  PostPosted: 23/Sep/2009 19:20
onIntermediate


Joined: 10-Nov-2007
Posts: 35

Status: Offline
kedua fungsi milik fcomputer itu kukira bener semua. Tapi sayang fcomputer tidak menjelaskan yg dimaksud dengan gagal.
coba lebih spesifik, mungkin nanti ada yg bisa bantu.
Cantumkan juga apa isi dari parameter sLongName pada kasus anda , dan berapa nilai kembalian dari fungsi API GetShortPathName()
 
 View user's profile Send private message  
Reply with quote Back to top
DelphiExpert
Location:
Post subject: RE: Sepele tapi GAGAL!!  PostPosted: 28/Sep/2009 18:35
onMage


Joined: 06-Feb-2006
Posts: 2401

Fungsi ini telah ada di SysUtils.pas

code : pascal
  1. uses SysUtils;
  2.  
  3. // berikut cuplikannya
  4.  
  5. function ExtractShortPathName(const FileName: string): string;
  6. var
  7. Buffer: array[0..MAX_PATH - 1] of Char;
  8. begin
  9. SetString(Result, Buffer,
  10. GetShortPathName(PChar(FileName), Buffer, SizeOf(Buffer)));
  11. end;
Parsed in 0.002 seconds, using GeSHi

_________________
Dude, if you don't understand the basics and just want to get someone else write the code for you, it means you really shouldn't study computer science. Find a different field.
http://delphiexpert.wordpress.com
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits


| Register | Lost Password ? |