I can see what your goal is, but you can put all that code in a stored
procedure and then your code that would be used throughout your app would be
something like this:

set var vdrive = (call sp_getdrive(arg1,arg2))

where Arg1 might be the Title for the Popup and Arg2 might be a list of
excluded drives that would be stored in the DB which could be further parsed
based on who (username) ran the SP.  This is one of those perfect examples
of the proper use of Stored Procedures where you can reuse the code over and
over without having to maintain it in many places in your app.  If your are
afraid of Stored Procedures, then put the code in a VarChar datatype in a
table and use the Run Select option to get the same effect:

run select cmdData from cmdTable wher cmdName = 'GetDrives'

And doesn't the RBrowse.dll (windows only) return a drive letter if that is
all you select?


----- Original Message -----
From: "David M. Blocker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 04, 2002 11:01 AM
Subject: Re: Database Backup File to Your Choice of Drive - Razzak's Reply


> Mike
>
> Yes, but we want it to work with simply
>
> CHOOSE vDrive FROM #DRIVES
>
> Without the extra steps!
>
> David Blocker
>
> ----- Original Message -----
> From: "MikeB" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, November 04, 2002 10:00 AM
> Subject: Re: Database Backup File to Your Choice of Drive - Razzak's Reply
>
>
> > How soon everyone forgets....
> >
> > Save the following to a file then run it. It will display a list of
> > AVAILABLE drives including Network drives.
> >
> > OUTPUT Drives.mnu
> >      WRITE 'Available'
> >      WRITE 'popup |Choose Drive|'
> >      WRITE '#DRIVES'
> >      OUTPUT SCREEN
> >      CHOOSE vDrive FROM Drives.mnu AT 5,10 CLEAR
> > return
> >
> > From here down is the complete list of #puppies usable in RBASE.  Clip
> this
> > out and SAVE IT...
> >
> > *(   In R:BASE 3.1, you can choose a file from a list of files when
> >     )
> > *(  want to execute a disk function. By using the undocumented
> > e       )
> > *(   described in this article, you can add this functionality to
> >      )
> > *(   applications. All you need to do is use a special keyword option
> > ch   )
> > *(   as #DRIVES, #DIR, or #LFILES in a pop-up or check box menu
> >       )
> > *(
> >  )
> > *(   The special options, referred to as pound puppies, make the
> >      )
> > *(   dynamic--they pull current information from the computer or from
> >     )
> > *(   currently open database as appropriate. Use the following commands
> >    )
> > *(   your application to create the dynamic menu, replacing #PUPPY with
> > he  )
> > *(   actual option you want to
> >      )
> >
> >      OUTPUT filename.$$$
> >      WRITE 'Title'
> >      WRITE 'POPUP |Choose from this list.|'
> >      WRITE '#puppy'
> >      OUTPUT SCREEN
> >
> > *(   After creating the menu, use the CHOOSE command to prompt the user
> >    )
> > *(   choose from the list. For example, you might use this
> >         )
> > *(
>
> >  )
> >      CHOOSE vfile FROM filename.$$$ AT 5,10 CLEAR
> > *(
> >  )
> > *(   If you prefer, you can also create check box menus by changing
> > UP    )
> > *(   on the third line to
> >        )
> > *(
> >  )
> > *(
> >  )
> > *(
> >            )
> > *(
> >            )
> > *(   This example uses #LFILES to list the files in the current
> > rectory:   )
> > *(
> >  )
> >      OUTPUT f.$$$
> >      WRITE 'Title'
> >      WRITE 'POPUP |Choose a file.|'
> >      WRITE '#LFILES'
> >      OUTPUT SCREEN
> >      CHOOSE vfile FROM f.$$$ AT 5,10 CLEAR
> >
> > *(   To list files with a specific extension such as .TXT, include
> >     )
> > *(   extension following #LFILES, as in this
> >          )
> > *(
> >  )
> >      OUTPUT f.$$$
> >      WRITE 'Title'
> >      WRITE 'POPUP |Choose a file.|'
> >      WRITE '#LFILES TXT'
> >      OUTPUT SCREEN
> >      CHOOSE vfile FROM f.$$$ AT 5,10 CLEAR
> > *(
> >  )
> > *(   Include only the extension, not the period (TXT not .TXT). The
> >      )
> > *(   names show up in the menu without the extension (MYDOC not
> > YDOC.TXT).  )
> > *(
> >  )
> > *(   To enable the user to choose multiple files at the same time, use
> >   )
> > *(   check box menu instead of a pop-up menu, as in this
> >          )
> > *(
> >  )
> >      OUTPUT f.$$$
> >      WRITE 'Title'
> >      WRITE 'CHKBOX |Choose several files.|'
> >      WRITE '#LFILES'
> >      OUTPUT SCREEN
> >      CHOOSE vfile FROM f.$$$ AT 5,10 CLEAR
> > *(
> >  )
> > *(
> >  )
> > *(   All the
> >         )
> > *(
> >                   )
> > *(   Here's a complete list of all the pound puppies you can use in
> > p-up   )
> > *(   and check box menu
> >        )
> > *(
> >  )
> > *(     []  #LFILES--List all the files in the current
> >            )
> > *(     []  #LFILES ext--List just the file names (not the extensions)
> >    )
> > *(         the files in the current directory that have the
> > on        )
> > *(
> >                    )
> > *(     []  #DRIVES--List all accessible drives on the computer
> > uding     )
> > *(         network drives. The current drive is included in the list
> >     )
> > *(         it's gray to prevent the user from choosing
> >     )
> > *(     []  #DIR--List all the subdirectories in the current directory
> >     )
> > *(         includes an option for Parent Directory if there is one.
> >     )
> > *(         current directory is included in the list but it's gray
> >    )
> > *(         prevent the user from choosing
> >     )
> > *(     []  #TABLES--List all the tables in the currently open
> > ase.      )
> > *(     []  #RBASE--List all the R:BASE tables in the currently
> >      )
> > *(         database, excluding any dBASE files that may be attached to
> > e   )
> > *(
> >                   )
> > *(     []  #DBASE--List all the dBASE files that are attached to
> >     )
> > *(         currently open R:BASE
> >           )
> > *(     []  #COLUMNS IN tblname--List all columns in the specified
> > e.     )
> > *(     []  #FORMS--List all the forms in the currently open
> > e.        )
> > *(     []  #REPORTS--List all the reports in the currently open
> > abase.    )
> > *(     []  #LABELS--List all the labels in the currently open
> > ase.      )
> > *(     []  #DATABASE--List all the R:BASE databases in the
> >         )
> > *(
> >                    )
> > *(     []  #GLOBAL--List all the global variables currently residing
> >    )
> > *(
> >                 )
> > *(     []  #VIEWS--List all the views in the currently open
> > e.        )
> > *(     []  #TBLVIEWS--List all the tables and all the views in
> >     )
> > *(         currently open
> >           )
> > *(     []  #APP--List all the R:BASE application files with .APX
> > xtensions  )
> > *(         in the current
> >            )
> >
> > ----- Original Message -----
> > From: "David M. Blocker" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, November 04, 2002 8:15 AM
> > Subject: Re: Database Backup File to Your Choice of Drive - Razzak's
Reply
> >
> >
> > > Razzak
> > >
> > > You tease, you!!  Great idea Randy, great response Razzak! I can't
wait!
> > >
> > > David Blocker
> > >
> > > ----- Original Message -----
> > > From: "A. Razzak Memon" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Sunday, November 03, 2002 10:01 PM
> > > Subject: Re: Database Backup File to Your Choice of Drive - Razzak's
> Reply
> > >
> > >
> > > >
> > > > At 12:02 PM 11/4/2002 +1100, Randy Peterson wrote:
> > > >
> > > > >This sounds like choose might be better than a
> > > > >dialog.  That way only valid options will appear for the
> > > > >user to choose from.
> > > > >
> > > > >On my machine (CVAL('drives')) gave me the following
> > > > >value:  CDENs
> > > > >
> > > > >You could use string commands to punctuate this list.
> > > > >
> > > > >Perhaps you could request from RDCC one of the
> > > > >following additional commands:
> > > > >
> > > > >LIST DRIVES
> > > > >
> > > > >CHOOSE varname FROM #DRIVES
> > > > >
> > > > >If (CVAL('drives')) returned a comma delimited list,
> > > > >you could use that in a command like:
> > > > >
> > > > >CHOOSE vDrive from #LIST (CVAL('drives'))
> > > > >
> > > > >You could then use those results in a choose statement.
> > > >
> > > >
> > > > Randy Peterson, Myron Finegold and Larry Lustig:
> > > >
> > > > It would be really COOL if the (CVAL('Drives')) function returns
> > > > the list of available/mapped drives with a comma delimited list.
> > > > Similar to (CVAL('Printers')) function in TGRB2000 (ver 6.5++).
> > > >
> > > > Then, you could use something like the following:
> > > >
> > > > Example 01:
> > > >
> > > > -- GetDriveForBackup.RMD
> > > >
> > > > CLS
> > > > SET AUTODROP OFF
> > > > SET RBGSIZE CENTER CENTER 800 600
> > > > PAUSE 3 USING 'Searching for Available Drives' CAPTION 'System
Backup'
> > AT
> > > 14 36
> > > > SET VAR vTitle TEXT = 'Select Drive For Backup'
> > > > SET VAR vCaption TEXT = 'Available Drives'
> > > > SET VAR vDriveList TEXT = (CVAL('Drives'))
> > > > SET VAR vLines INTEGER = (((SLEN(.vDriveList))/2)+1)
> > > > SET VAR vDriveToBackup TEXT = NULL
> > > >
> > > > CLS
> > > > CHOOSE vDriveToBackup FROM #LIST .vDriveList AT 12 32 +
> > > > TITLE .vTitle CAPTION .vCaption LINES .vLines FORMATTED
> > > > IF vDriveToBackup IS NULL THEN
> > > >     GOTO Done
> > > > ENDIF
> > > >
> > > > -- Check to make sure that drive is accessible and/or ready?
> > > > SET VAR vDriveReady = (GETVAL('GetDriveReady',.vDriveToBackup))
> > > > IF vDriveReady = '0' THEN
> > > >     CLS
> > > >     SET VAR vMsg TEXT = ('Selected Drive'&.vDriveToBackup&'is NOT
> > > Accessible!')
> > > >     PAUSE 2 USING .vMsg CAPTION 'System Backup' AT 14 30
> > > >     GOTO Done
> > > > ENDIF
> > > >
> > > > -- Now, you know that the exact drive letter for backup
> > > > -- You also know that the drive is ready and/or accessible
> > > > -- Do what you have to do here ...
> > > >
> > > > LABEL Done
> > > > CLS
> > > > CLEAR VAR vTitle, vCaption, vLines, vDriveToBackup, vDriveReady,
vMsg
> > > > QUIT TO MainMenu.RMD
> > > > RETURN
> > > >
> > > > It would be NICE if we can use above sample in 6.5++
> (Build:1.860xRT03)!
> > > >
> > > > Oh WAIT .. I'm sitting here beside the head of the Dream Team (Wayne
> > > Erickson)
> > > > and he is giving me a hard time to implement this into the upcoming
> > inline
> > > > patch-3.
> > > >
> > > > I guess, we'll have to wait for the Final Beta (Release Candidate
3),
> to
> > > be
> > > > released
> > > > shortly.
> > > >
> > > > Very Best Regards,
> > > >
> > > > Razzak.
> > > >
> > > >
> > > > ================================================
> > > > TO SEE MESSAGE POSTING GUIDELINES:
> > > > Send a plain text email to [EMAIL PROTECTED]
> > > > In the message body, put just two words: INTRO rbase-l
> > > > ================================================
> > > > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > > > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > > > ================================================
> > > > TO SEARCH ARCHIVES:
> > > > http://www.mail-archive.com/rbase-l%40sonetmail.com/
> > > >
> > >
> > >
> > > ================================================
> > > TO SEE MESSAGE POSTING GUIDELINES:
> > > Send a plain text email to [EMAIL PROTECTED]
> > > In the message body, put just two words: INTRO rbase-l
> > > ================================================
> > > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > > ================================================
> > > TO SEARCH ARCHIVES:
> > > http://www.mail-archive.com/rbase-l%40sonetmail.com/
> > >
> >
> > ================================================
> > TO SEE MESSAGE POSTING GUIDELINES:
> > Send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: INTRO rbase-l
> > ================================================
> > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > ================================================
> > TO SEARCH ARCHIVES:
> > http://www.mail-archive.com/rbase-l%40sonetmail.com/
> >
>
>
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================
> TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
>

================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to