[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

700.0. "Unexpected behavior with PROMPT / YESNO_PROMPT" by OCTAVE::VIGNEAULT (Java-Man DGMNSBMMC) Mon May 18 1992 16:14

     Here's a slice of some named data I've been working on, and I'm having a 
     very strange problem with it. After asking if they want to delete the file
     in the XOP ~~DELETE_1~~, the value of OA$PROMPT_TEXT is N.  When it gets 
     to the .IF statement, it reads the value of OA$PROMPT_TEXT as Y and 
     proceeds to delete the document.  I ascertained this using DEBUG.

     Anyone have any idea why OA$PROMPT_TEXT is getting reset to the value 
     of Y?  Any thoughts on the matter would be greatly appreciated !

     I've also tried YESNO_PROMPT with the same results.
    
     BTW, ALL-IN-1 Vers 3.0
    
	Thanks, Larry

;;D;;

GET #CXPDEL="SYS$LOGIN:" *CXP.TEXT[OA$SCROLL_ADDRESS] ".WPL;"\
GET #CXPFILE=OA$DIR:"*.WPL".%WHOLE[#CXPDEL]\
.IF #CXPFILE NES "" THEN XOP "~~DELETE_1~~"
 ELSE DISPLAY Could not find the specified file\FORCE

;;~~DELETE_1~~;;

PROMPT "Do you really want to delete the selected file [Y/N] ? "\ 
OA$FLD_STAY\
 .IF OA$PROMPT_TEXT=OA$Y THEN
 GET OA$DCL="DELETE " #CXPFILE\\
 WRITE DELETE *CXP %KEY=OA$SCROLL_ADDRESS\\
 OA$SCL_UPDATE\\
 OA$SCL_REFRESH\\
 DISPLAY Specified file deleted\\FORCE


    
T.RTitleUserPersonal
Name
DateLines
700.1Clarification on one point ..OCTAVE::VIGNEAULTJava-Man DGMNSBMMCMon May 18 1992 16:273
    Let me clarify the base note, I'm answering N to the prompt. 
    
    - Lv
700.2Pilot error, or typo?SHALOT::NICODEMWho told you I'm paranoid???Mon May 18 1992 17:2520
	I hope that .0 just contained a typo, but just in case:

� PROMPT "Do you really want to delete the selected file [Y/N] ? "\ 
� OA$FLD_STAY\
�  .IF OA$PROMPT_TEXT=OA$Y THEN
�  GET OA$DCL="DELETE " #CXPFILE\\
�  WRITE DELETE *CXP %KEY=OA$SCROLL_ADDRESS\\
�  OA$SCL_UPDATE\\
�  OA$SCL_REFRESH\\
�  DISPLAY Specified file deleted\\FORCE

	I don't think that this .IF statement is going to do what you expect.
What ALL-IN-1 will do is to evaluate "OA$PROMPT_TEXT=OA$Y" as a symbol -- and
then, based on whether that comes back as a true or false, will continue.

	I think you want something like:

	.IF OA$PROMPT_TEXT EQS OA$Y...

	F
700.3Add spaces around the "="HYTIDE::CREAMERKeep a low profileMon May 18 1992 17:389
    
>   .IF OA$PROMPT_TEXT=OA$Y THEN
    
    Try ".IF OA$PROMPT_TEXT = OA$Y THEN"...
    I believe that the spaces around the "=" operator are required.
    
    HTH,
    
    Jack
700.4Frank beats me again!!HYTIDE::CREAMERKeep a low profileMon May 18 1992 17:391
    
700.5Add a couple of spaces ..OCTAVE::VIGNEAULTJava-Man DGMNSBMMCMon May 18 1992 17:4713
    
    I just got some mail from the famed John Wolfe, and he happened 
    across the solution.  Instead of 
    
    .IF OA$PROMPT_TEXT=OA$Y THEN
    
    change to ..
    
    .IF OA$PROMPT_TEXT = OA$Y THEN
    
    works fine.  Could this be a bug ?
    
    - Larry
700.6OCTAVE::VIGNEAULTJava-Man DGMNSBMMCMon May 18 1992 17:497
    
    Whoops,
    
     Didn't see .3 & .4, thanks all.  Didn't realize that the spaces had
    to surround the "=" sign.
    
    Havin fun - Larry
700.7I always use EQS etceteraIOSG::SHOVEDave Shove -- REO-D/3CMon May 18 1992 18:0517
    RE: .5 - It's not really a bug. The correct syntax is to have spaces
    around the = (this is documented somewhere, but I think it's well
    hidden). Just as you'd need spaces round EQS (obviously).
    
    Your original fooled the parser and made it try to evaluate 
    
    	OA$PROMPT_TEXT=OA$Y
    
    as a symbol. The symbol processor thought it was being asked to do
    
    	GET OA$PROMPT_TEXT=OA$Y
    
    so that's what it did - as you saw! 
    
    The spaces around the = ensure that the pieces are treated separately.
    
    Dave.