| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Declaring variables a |
"Stefanie" wrote in message
news:37e66$41b8391c$513b4d44$10299{at}news1.zonnet.nl...
| Steve,
|
| > As far as I can tell, Put will write a 2 byte length before writing
a
| > variable length string to a file opened Random (UDT or not), which
| > allows Get to retrieve it correctly. The total record length would
have
| > to be long enough for that. I don't believe you actually have to pad
out
| > the string length unless you want to.
|
| Yes i read that too, but i don't understand how to do this:
|
| This are the variables declared in my module.
|
| Type Record
| vDateTime As String * 19
| vFileName As String
| End Type
|
| Public RecVar As Record
|
| Using vFileName As String * 255 gives my enough for een full path, but
most
| of the time it's wasting space.
|
| I use this for opening my file:
|
| Open strFileName For Random As #Dnr Len = Len(RecVar)
|
| But it's gives an error. "Bad record lenght"
|
| Maybe somebody can offer me an example how to use the aforesaid.
|
| Stefanie
|
Len(RecVar) will not include any space for the vFileName string if it is
declared as variable length, hence the bad record length error. You
would have to make the Len in the Open statement equal to the longest
length you expect: approx. Len(RecVar)+255.
If you don't want to reserve 255 for every vFileName, you can't really
use a fixed record length, which means working in Binary rather than
Random. It gets a little more complicated, but Jerry French can help you
out if you need it. Me, I would just waste some disk space, it seems
cheap enough, and go with a fixed length record. 512 sounds like a nice
size.
---
þ RIMEGate(tm)/RGXPost V1.14 at BBSWORLD * Info{at}bbsworld.com
---
* RIMEGate(tm)V10.2áÿ* RelayNet(tm) NNTP Gateway * MoonDog BBS
* RgateImp.MoonDog.BBS at 12/9/04 9:37:51 PM
* Origin: MoonDog BBS, Brooklyn,NY, 718 692-2498, 1:278/230 (1:278/230)SEEN-BY: 633/267 270 5030/786 @PATH: 278/230 10/345 106/1 2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.