MSI Factory 2.3

String.AbbreviateFilePath

String.AbbreviateFilePath

This is the first topic This is the last topic  

String.AbbreviateFilePath

This is the first topic This is the last topic  

OverviewExamples

string String.AbbreviateFilePath (

string FilePath,

number Characters )

Example 1

internal_path = "c:\\windows\\system32\\drivers\\ta_da\\foldername\\driver.vxd";

display_path = String.AbbreviateFilePath(internal_path, 30);

Converts the lengthy internally used path into a more manageable size to display to the user (c:\windows\...\driver.vxd)

Example 2

-- callback function for File.Delete action

function DeleteCallBack(source, deleted, total)

   -- set the message and status text

   StatusDlg.SetMessage("Delete: " .. String.AbbreviateFilePath(source, 10));

   StatusDlg.SetStatusText("File " .. deleted .. " of " .. total .. ".");

 

   -- show the cancel button

   StatusDlg.ShowCancelButton(true, "Cancel");

 

   -- check if the cancel button was pressed

   bCancel = StatusDlg.IsCancelled();

 

   -- if the cancel button was pressed, return false, else return true.

   if bCancel then

       return false;

   else

       return true;

   end

end

 

 

 

-- show the status dialog

StatusDlg.Show();

 

-- delete all files in folder c:\temp, using the DeleteCallBack function

File.Delete("c:\\temp\\*.*", true, true, true, DeleteCallBack);

 

 

-- Hide the status dialog

StatusDlg.Hide();

Deletes all files and folders from c:\temp, and uses a callback function to display status to the user.

See also: Related Actions


Learn More: Indigo Rose Software - MSI Factory - Buy Now - Contact Us