Jump to content

Kodumdaki Hatayı Anlayamıyorum!


PColik
 Share

Recommended Posts

Arkadaşlar ben AutoPlay Medi Studio'nun kendi yardım bölümünden aldığım bir kodu kendi kriterlerime göre değiştirdim, fakat aşağıda ki kodda 9. satırda hata veriyor. Neden olabilir?





-- Get the path to the user's My Documents folder.
DestFolder = Shell.GetFolder(SHF_PROGRAMFILES);

-- Create a folder in the user's My Documents folder called "Copied Files".
Folder.Create(_ProgramFilesFolder.."\\Kolay Ara");

--Copy all files within the Docs folder on the CD-ROM to the destination.
StatusDlg.Show(MB_ICONNONE, false);
File.Copy("AutoPlay\\Docs\\Türkçe Versiyon", ProgramFilesFolder.."\\Kolay Ara\\", true, true, false, true, nil);

-- Check to see if the File.Copy action failed by getting it's error code.
error = Application.GetLastError();
StatusDlg.Hide();

-- If it failed (not equal to 0), display a dialog informing the user.
-- If it succeeded, open an explore window showing the "Copied Files" folder.
if error ~= 0 then
result = Dialog.Message("Error", "There was an error copying the files to your system. Please try again.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
else
Shell.Execute(ProgramFilesFolder.."\\Kolay Ara", "explore", "", "", SW_SHOWNORMAL);
end
Link to comment
Share on other sites

Tamam sorunu düzelttim fakat şimdi başka bir sorum olacaktı. Kodu aşağıdaki ile değiştirdim ve çalıştı.





-- Get the path to the user's My Documents folder.
DestFolder = Shell.GetFolder(SHF_PROGRAMFILES);

-- Create a folder in the user's My Documents folder called "Copied Files".
Folder.Create(DestFolder.."\\Kolay Ara\\Türkçe Versiyon");

--Copy all files within the Docs folder on the CD-ROM to the destination.
StatusDlg.Show(MB_ICONNONE, false);
File.Copy("AutoPlay\\Docs\\Türkçe Versiyon\\*.*", DestFolder.."\\Kolay Ara\\Türkçe Versiyon\\", true, true, false, true, nil);

-- Check to see if the File.Copy action failed by getting it's error code.
error = Application.GetLastError();
StatusDlg.Hide();

-- If it failed (not equal to 0), display a dialog informing the user.
-- If it succeeded, open an explore window showing the "Copied Files" folder.
if error ~= 0 then
result = Dialog.Message("Error", "There was an error copying the files to your system. Please try again.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
else
Shell.Execute(DestFolder.."\\Kolay Ara\\Türkçe Versiyon", "explore", "", "", SW_SHOWNORMAL);
end




Bu kodu kullandığım zaman StatusDlg açıldığında başlıkta Copying, dosya kaynağında from, kopyalanacak hedefte ise to yazıyor. Bunları düzeltme imkanım var mı?

Link to comment
Share on other sites

  • Editor

Olmaz tabi direk yazmayacaksın Globalde StatusDlg ile ilgili bir fonksion oluşturacaksın ve File.Copy nin Callback function kısmına globaldeki değişkenini tanımlayacaksın.

Link to comment
Share on other sites

Mesela bu şekildemi?

function status()
StatusDlg.SetTitle("Kopyalanıyor")
StatusDlg.SetStatusText("Kopyalanan Dosya")
StatusDlg.SetMessage("Hedef")
end





[indent=1][color=#282828]
[b][b]File.Copy("AutoPlay\\Docs\\Türkçe Versiyon\\*.*", DestFolder.."\\Kolay Ara\\Türkçe Versiyon\\", true, true, false, true, [color=#ff0000]status[/color]);[/b][/b][/color]
[color=#282828]
Aklımdan yazdım yanlış olabilir[/color][/indent]

Edited by nightmare3519
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...