Menu

#478 FILENAMEDIALOG returns 0 if cancel.

3.3.0
closed
5
2012-08-14
2007-12-20
Anonymous
No

Using the filenamedialog function to prompt for filename. If user presses CANCEL or ESCAPE, a zero (0) is returned instead of null string as document states.

Discussion

  • Mark Miesfeld

    Mark Miesfeld - 2007-12-20

    Logged In: YES
    user_id=191588
    Originator: NO

    I'll take a look at that.

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-12-21

    Logged In: YES
    user_id=191588
    Originator: NO

    The initial code check in to CVS shows that for ooRexx, the FileNameDialog has always returned 0 if the user cancels or uses escape.

    250 fSuccess = OpenFileDlg(load, pszFiles, pszInitialDir, szFilter, hWnd, title,
    251 defext, multi, chSepChar);
    252
    253 if ( pszInitialDir )
    254 LocalFree(pszInitialDir);
    255 if ( fSuccess )
    256 {
    257 / we simply use the allocated string as return code and let REXX free it /
    258 retstr->strptr = pszFiles;
    259 retstr->strlength = strlen(pszFiles);
    260 return 0;
    261 }
    262
    263 if (CommDlgExtendedError())
    264 RETERR
    265 else
    266 RETC(0);
    267 }

    So, in my mind this is a documentation error. I'll fix the documentation.

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-12-21

    Logged In: YES
    user_id=191588
    Originator: NO

    Committed revision 1700.

    I fixed the documentation. FileNameDialog has always returned 0 when the user cancels the dialog, and it has always been documented wrong. At least all the way back to IBM Object REXX 2.1 which is the earliest Object Rexx I still have available.

     
  • Mark Miesfeld

    Mark Miesfeld - 2010-02-22

    This was a documentation clarification bug. The clarification was in the 4.0.0 release docs.

     

Anonymous
Anonymous

Add attachments
Cancel