[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | AMIGA NOTES |
Notice: | Join us in the *NEW* conference - HYDRA::AMIGA_V2 |
Moderator: | HYDRA::MOORE |
|
Created: | Sat Apr 26 1986 |
Last Modified: | Wed Feb 05 1992 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 5378 |
Total number of notes: | 38326 |
2497.0. "BUG CITY!!!!!" by NZOV01::MCKENZIE (Help STOP the greenhouse effect!) Sun Apr 23 1989 10:18
OK BOYS AND GIRLS....Time for MORE random access file questions....
Ive been writing a database to store records from my paintball
social club...I'm also going to do other stuff with the info like
print membership cards etc...
now I've come up against a weird problem
I open a random acces file (that doesnt exist)
I get all the information i need - then gosub to a routine
which LSETs all variables to random file buffers
the problem is that one field - the membership number field
keeps right justifying and dropping a digit from the variable at
LSET time...I have checked record lengths,field definitions etc
all- seems to be ok...the routine looks something like this
I%=1:[ALL TMPVARIABLES CHECKED HERE]
OPEN "R",#1,"DF1:SOCIAL-MEMBERS.DAT",117
FIELD #1,15 AS SURNAM$,5 AS ID$,15 AS INITIAL$,11 AS DOB$,....
GET #1,I%:X=EOF(1):IF X=-1 GOTO [SET variables]
[set variables]
LSET SURNAM$=TMPSURNAM$
LSET ID$=TMPID$
.
.
.
PUT #1,I%:CLOSE #1:RETURN....
every field is correctly written except the member number
field...instead of being "10001" it is written as " 1000"
what am I doing wrong - Randy/Ed/anyone - Help!
T.R | Title | User | Personal Name | Date | Lines |
---|
2497.1 | whoops | NZOV01::MCKENZIE | Help STOP the greenhouse effect! | Sun Apr 23 1989 10:19 | 1 |
| forgot to mention that all this is done from Amigabasic....
|
2497.2 | Perhaps a leading sign space in ID$ | DISCVR::HAXTON | | Sun Apr 23 1989 21:09 | 13 |
| It looks like the problem may be with ID$. When it is initially
made into a string from a numeric value it probably has a leading
space inherent (since it is a positive number) and the fieldwidth
for that particular variable is 5 characters. Hence, it keeps the
leading space and the other 4 characters and drops the trailing
character. I suggest that you perform an
ID$=RIGHT$(ID$,len(ID$)-1)
prior to the LSET which should remove the leading sign space from
the ID$ string.
Kevin
|
2497.3 | rather... | DISCVR::HAXTON | | Sun Apr 23 1989 21:21 | 7 |
| Let's rephrase that a little so that it matches your program better. Try
LSET ID$=RIGHT$(TMPID$,LEN(TMPID$)-1)
Anyway, you get the idea...
Kevin
|
2497.4 | thank you... | NZOV01::MCKENZIE | Help STOP the greenhouse effect! | Sun Apr 23 1989 23:30 | 1 |
| re .-1 - thanks Kevin - I'll try that...
|
2497.5 | done - thank you for your help | NZOV01::MCKENZIE | Help STOP the greenhouse effect! | Tue Apr 25 1989 18:58 | 6 |
| Kevin - IT WORKED - Thank you very much
regards
Phil
|