Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to save a type set 1

Status
Not open for further replies.

Casmaran

Programmer
Jan 5, 2000
1
US
I'm using the CMDialog function to save and open a file that I'm creating through my program. I save information fine but, when I open a file I have to open it twice and it seems that the same pieces of information are blankedout of spots.<br>
Private Sub Getfields()<br>
SHEET.cname.Caption = Charfile.charname<br>
SHEET.crace.Caption = Charfile.charrace.....<br>
End Sub<br>
Private Sub savefile()<br>
Pos=1,Recordlen=Len(Charfile),Filenum=Freefile,Filename=cmdialog.filename,<br>
Open Filename For Random As Filenum Len = Len(Charfile),<br>
Getfields, Put #Filenum, Position, Charfile, Close, End sub Type Character Character AS string*25, Charrace As String *35 .... End type&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &quot;Clueless&quot;<br>
<p>Casmaran<br><a href=mailto:DHellert@Aol.com>DHellert@Aol.com</a><br><a href= > </a><br>
 
What do you mean you have to open it twice? also the best way to open a Random file is with Type statements<br>
<br>
Type a<br>
field1 as string<br>
field2 as integer<br>
end type<br>
<br>
dim Recordset as a<br>
<br>
open &quot;C:\myfile&quot; for randon as #1 len=Recordset<br>
<br>
<br>

 
sorry change line typo in above<br>
open &quot;C:\myfile&quot; for randon as #1 len=Recordset<br>
to <br>
open &quot;C:\myfile&quot; for randon as #1 len=len(Recordset)<br>
also look in Help<br>
there is a more detailed exmaple &quot;Look for Type Statements&quot;<br>
<br>

 
&quot;randon&quot;? &lt;smile&gt; you don't mean &quot;random&quot; do you Doug?<br>
-ml <p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top