New topic: 

Eliminating "extra" steps in saving a file.

<http://forums.realsoftware.com/viewtopic.php?t=48042>

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        newyorkpaulie          Post subject: Eliminating "extra" steps 
in saving a file.Posted: Sun Jun 02, 2013 5:36 am                         
Joined: Sat Dec 30, 2006 6:52 pm
Posts: 123
Location: New York City                When I want to save a file I've updated 
using one of my programs a button press calls the code here:

  dim f as folderitem
  dim i as integer
  dim stream as binarystream
  dim theStoringFolder as String
  theStoringFolder = "/home/Documents/"
  f=getsaveFolderItem("", theStoringFolder + "myFile")
  if f<> nil then
  stream=f.createbinaryfile("myfiletype")
  stream.WriteLong myListBox.ListCount
  for i=0 to myListBox.listcount-1
  stream.writePString myListBox.list(i)
  next
  stream.close
  end if

I then have to press a key given this choice:
 [Save] [Cancel]

And then I have to press another key given this choice:
 '/home/Documents/myFile' already exists.
 Overwrite it?
 [Yes] [No]

Is there a way to eliminate these 2 key presses by adding instructions to my 
(above) code?   
                             Top                kermit          Post subject: 
Re: Eliminating "extra" steps in saving a file.Posted: Sun Jun 02, 2013 12:15 
pm                         
Joined: Mon May 30, 2011 12:56 am
Posts: 701                instead of 

f=getsaveFolderItem("", theStoringFolder + "myFile")

use

f=getFolderItem("", theStoringFolder + "myFile")   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to