Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

File.Open Not Finding File when path pulled from Registry

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • File.Open Not Finding File when path pulled from Registry

    Having a bit of trouble finishing a function that, after it verifies the path of a document, uses

    pdfInstallPath = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\MyApp\\27", "InstallPath", true);

    File.Open(pdfInstallPath.."sample.pdf", "", SW_SHOWNORMAL);

    *pdfInstallPath returns the correct pathing information, without the trailing backslash.

    This code returns "The Specified File could not be found" (after being run through:
    --Check to see if an error occurred.
    error = Application.GetLastError();

    -- If an error occurred, display the error message.
    if (error ~= 0) then
    Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    end


    I have tried appending the backslash \ using .. and \\, but have not had any luck. If you could tell me where I'm going wrong, it would be appreciated.

    Thanks again for your time and help
    - Thomas

  • #2
    Have you tried this:

    File.Open(pdfInstallPath.."\\sample.pdf", "", SW_SHOWNORMAL);
    --[[ Indigo Rose Software Developer ]]

    Comment


    • #3
      That works perfectly Lorne, thanks again for the help!

      Comment

      Working...
      X