Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More info about Random Access files
#13
Of course if you do want to get the length of the text to match the length of the file...

Code: (Select All)
Open "crap" For Output As #1: Close #1
Dim q As String * 10
q = "123"
Open "crap" For Random As #1 Len = 10
Put #1, , q
Close #1
q = ""
Open "crap" For Random As #1 Len = 10
Get #1, , q
Close #1
Print "|" + q + "|"
End

Note that q is displayed as 123 but it's really a 10-character string. You can use _Trim$() to remove those Chr$(32) spaces.

Pete
Reply


Messages In This Thread
RE: More info about Random Access files - by Pete - 02-24-2026, 01:44 AM
RE: More info about Random Access files - by Pete - 02-24-2026, 05:13 AM
RE: More info about Random Access files - by Jack - 02-24-2026, 02:41 PM
RE: More info about Random Access files - by Pete - 02-24-2026, 05:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Embedding and Extracting MANY files ! ahenry3068 20 1,501 11-15-2025, 10:19 AM
Last Post: ahenry3068
  random maze map. math help pmackay 4 553 08-10-2025, 11:22 AM
Last Post: pmackay
  Random Number Generator pmackay 14 1,231 07-30-2025, 12:56 PM
Last Post: SMcNeill
  generating a random number in the full range of that number? (Integer, Long) madscijr 2 643 05-01-2025, 09:11 PM
Last Post: madscijr
  program that stitches together a bunch of image files into one giant poster? madscijr 15 2,292 10-24-2024, 06:08 PM
Last Post: madscijr

Forum Jump:


Users browsing this thread: 1 Guest(s)